/[ascend]/trunk/pygtk/interface/filechooser.py
ViewVC logotype

Diff of /trunk/pygtk/interface/filechooser.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 365 by johnpye, Thu Mar 9 06:20:17 2006 UTC revision 366 by johnpye, Thu Mar 9 06:26:51 2006 UTC
# Line 1  Line 1 
1    
2  import platform, os  import platform, os
3  import gtk  import gtk
4    
# Line 20  class FileChooser: Line 21  class FileChooser:
21              except ImportError:              except ImportError:
22                  pass                  pass
23          self.iswin = False          self.iswin = False
24          self.chooser = gtk.FileChooserDialog()          self.chooser = gtk.FileChooserDialog()
25            self.chooser.add_buttons(gtk.STOCK_OPEN,42)
26    
27            
28      def add_filter(self,name,patternarray):      def add_filter(self,name,patternarray):
# Line 67  class FileChooser: Line 69  class FileChooser:
69                                    
70          return fname          return fname
71    
72      def do_gtk(self):      def do_gtk(self):
73          import gtk;          print "LAUNCHING..."
74            self.add_filter("Other files",["*.*"])
75            self.chooser.run()
76            print "DONE..."
77            return self.chooser.get_filename()
78                    
79    
80  f = FileChooser()  f = FileChooser()

Legend:
Removed from v.365  
changed lines
  Added in v.366

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22