Re: problem with FileChooserDialog in latest git



On Tue, Dec 28, 2010 at 2:35 AM, Tomeu Vizoso <tomeu tomeuvizoso net> wrote:
> On Tue, Dec 28, 2010 at 07:47, Robert Park <rbpark exolucere ca> wrote:
>> I inspected Gtk.py and as far as I can tell I am invoking the
>> constructor appropriately. I don't know why there's no add_button
>> method. Does anybody have any insight on this one?
>
> Wonder if it's because of some bug with accessing methods in a parent
> class from the overrides, this rings me a bell. Can you check if
> FileChooserDialog has only its own methods or if it also has the
> methods from its ascendancy?

I did some playing with this:

$ jhbuild run python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gtk
>>> dialog = Gtk.FileChooserDialog("Open", None, Gtk.FileChooserAction.OPEN)
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings
will not be saved or shared with other applications.
>>> dialog.run()

(.:2413): Gtk-WARNING **: GtkFileChooserWidget 0x17e3480 is mapped but
visible=1 child_visible=1 parent GtkBox 0x1840050 mapped=0
-4
>>>

That successfully displayed a full file chooser dialog with no
open/close buttons. Then this:

$ jhbuild run python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gtk
>>> dialog = Gtk.FileChooserDialog("Open", None, Gtk.FileChooserAction.OPEN, buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT))
>>> dialog.run()

(.:2481): Gtk-WARNING **: GtkFileChooserWidget 0x2925120 is mapped but
visible=1 child_visible=1 parent GtkBox 0x291e440 mapped=0
-6

This produced the expected dialogue with open and close buttons. I
then tried this:

$ jhbuild run python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gtk
>>> dialog = Gtk.FileChooserDialog("Open", None, Gtk.FileChooserAction.OPEN)
Gtk-Message: Failed to load module "pk-gtk-module":
libpk-gtk-module.so: cannot open shared object file: No such file or
directory
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings
will not be saved or shared with other applications.
>>> dialog.add_button(Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT)
<Button object at 0x1ea1370 (GtkButton at 0x1fff690)>
>>> dialog.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.ACCEPT)
<Button object at 0x1ea13c0 (GtkButton at 0x1fff930)>
>>> dialog.run()

(.:2520): Gtk-WARNING **: GtkFileChooserWidget 0x1f03480 is mapped but
visible=1 child_visible=1 parent GtkBox 0x1f60050 mapped=0

(.:2520): Gtk-WARNING **: Could not find the icon 'application-xml'.
The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
	http://icon-theme.freedesktop.org/releases
-4
>>>

And despite the warnings, it ALSO produced the dialogue with the
expected buttons.

So now I'm not sure what's going on. Did you guys just decide to
change the FileChooserDialog constructor at some point, breaking
compatibility? It seems that old code does not work but if I invoke it
differently it works fine.

-- 
http://exolucere.ca


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]