| Home | Trees | Indices | Help |
|---|
|
|
1 #!/bin/env python
2 # copyright (c) 2005
3 # the icecube collaboration
4 # $Id: $
5 #
6 # @version $Revision: $
7 # @date $Date: $
8 # @author Juan Carlos Diaz Velez <juancarlos@icecube.wisc.edu>
9 # @brief File chooser for saving and opening files in GtkIcetraConfig
10 # application
11 #########################################################################
12 import pygtk
13 pygtk.require('2.0')
14 import gtk
15 from os.path import expandvars
16
18 # Get the selected filename and print it to the console
20 filename = self.filew.get_filename()
21 self.parent.savefile(None,filename)
22 self.filew.destroy()
23
25 self.filew.destroy()
26
28 # Create a new file selection widget
29 self.parent = parent
30 self.filew = gtk.FileSelection("File selection")
31
32 self.filew.connect("destroy", self.destroy)
33 # Connect the ok_button to file_ok_sel method
34 self.filew.ok_button.connect("clicked", self.file_ok_sel)
35
36 # Connect the cancel_button to destroy the widget
37 self.filew.cancel_button.connect("clicked",
38 lambda w: self.filew.destroy())
39
40 # Lets set the filename, as if this were a save dialog,
41 # and we are giving a default filename
42 self.filew.set_filename(self.parent.GetConfigFile() or "myconfig.xml")
43
44 self.filew.show()
45
47 # Get the selected filename and print it to the console
49 self.filename = self.filew.get_filename()
50 self.parent.getconfig(self.filename)
51 self.filew.destroy()
52
54 self.filew.destroy()
55
57 # Create a new file selection widget
58 self.parent = parent
59 self.filew = gtk.FileSelection("File selection")
60 self.filename = filename
61
62 self.filew.connect("destroy", self.destroy)
63 # Connect the ok_button to file_ok_sel method
64 self.filew.ok_button.connect("clicked", self.file_ok_sel)
65
66 # Connect the cancel_button to destroy the widget
67 self.filew.cancel_button.connect("clicked",
68 lambda w: self.filew.destroy())
69
70 self.filew.show()
71
72
74 # Get the selected filename and print it to the console
76 filename = self.filew.get_filename()
77 self.parent.pdb.loadfile(filename)
78 self.filew.destroy()
79
81 self.filew.destroy()
82
84 # Create a new file selection widget
85 self.parent = parent
86 self.filew = gtk.FileSelection("File selection")
87
88 self.filew.connect("destroy", self.destroy)
89 # Connect the ok_button to file_ok_sel method
90 self.filew.ok_button.connect("clicked", self.file_ok_sel)
91
92 # Connect the cancel_button to destroy the widget
93 self.filew.cancel_button.connect("clicked",
94 lambda w: self.filew.destroy())
95
96 self.filew.show()
97
99 # Get the selected filename and print it to the console
101 filename = self.filew.get_filename()
102 self.parent.pdb.savefile(filename)
103 self.filew.destroy()
104
106 self.filew.destroy()
107
109 # Create a new file selection widget
110 self.parent = parent
111 self.filew = gtk.FileSelection("File selection")
112
113 self.filew.connect("destroy", self.destroy)
114 # Connect the ok_button to file_ok_sel method
115 self.filew.ok_button.connect("clicked", self.file_ok_sel)
116
117 # Connect the cancel_button to destroy the widget
118 self.filew.cancel_button.connect("clicked",
119 lambda w: self.filew.destroy())
120
121 # Lets set the filename, as if this were a save dialog,
122 # and we are giving a default filename
123 self.filew.set_filename(expandvars("$HOME/paramdb.xml"))
124
125 self.filew.show()
126
130
131 if __name__ == "__main__":
132 GtkFileChooser(None)
133 main()
134
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Mon May 3 21:25:58 2010 | http://epydoc.sourceforge.net |