[pygtk] FileChooserButton forgets changed file
Andrew Steele
steeley.uk at gmail.com
Fri Jul 9 15:10:42 WST 2010
On 9 July 2010 05:52, Jason Heeris <jason.heeris at gmail.com> wrote:
> Consider the attached program. Try this:
>
> 1. Select a file that is in a directory *with at least one other file*
> 2. Click "Check" to verify the path
> 3. Open the file in a text editor, modify it and save it
> 4. Click "Check" again
>
> When I try this, the path has changed! Have I done something wrong, or
> is this a bug?
>
> — Jason
>
> ----
> import pygtk
> import gtk
>
> class FCButtonTest(gtk.Window):
>
> def __init__(self):
> super(FCButtonTest, self).__init__()
> self.fcb = gtk.FileChooserButton("Go nuts")
> button1 = gtk.Button("Check")
>
> button1.connect('clicked', self.do_check)
>
> box1 = gtk.HBox()
> box1.pack_start(self.fcb)
> box1.pack_start(button1, expand=False)
>
> self.add(box1)
>
> def do_quit(source):
> gtk.main_quit()
>
> self.connect('destroy', do_quit)
>
> def do_check(self, source):
> print self.fcb.get_file().get_path()
>
> if __name__ == "__main__":
> FCButtonTest().show_all()
> gtk.main()
> ----
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
I couldn't reproduce what you're seeing unless I'm doing something wrong,
which is likely. The only query I had, and maybe it could be causing a
problem is why you've used self.fcb.get_file().get_path() instead of
self.fcb.get_filename().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20100709/98d71501/attachment.htm
More information about the pygtk
mailing list