[pygtk] Help with modal in Gtk::FileChooserDialog

Gustavo J. A. M. Carneiro gjc at inescporto.pt
Tue Dec 13 19:06:13 WST 2005


Ter, 2005-12-13 às 04:04 +0100, dannym escreveu:
> Hi,
> 
> Am Donnerstag, den 01.12.2005, 12:23 +0000 schrieb Gustavo J. A. M.
> Carneiro:
> > [...]
> 
> >   You need to call dialog.destroy().  "del dialog" doesn't work because
> > gtk+ itself always keeps one last reference to toplevel windows until
> > you destroy() them (or until they are implicitly destroyed by the user
> > clicking the close window button).
> > 
> >   This must be documented somewhere, I would imagine?...
> 
> Hard to say, really.
> 
> In my gtk+ bindings (for pascal), I usually ref and sink any gtkobject
> at the beginning (i.e. in my WrapGObject function - like
> pygobject_from_??? or-what-they-are-called-in-pygtk) to stop unexpected
> stuff like what you describe from happening ... now if pygtk does that
> or not, I don't know... (note that my gtk pascal bindings are refcounted
> themselves so it's different from a mixed gc/refcount environment, I'd
> imagine)

  Nope, you have the same problem.  ref/sink is done by pygtk as well,
and it doesn't help one bit; check gtk+/gtk/gtkwindow.c, function
gtk_window_init.

  Regards.

-- 
Gustavo J. A. M. Carneiro
<gjc at inescporto.pt> <gustavo at users.sourceforge.net>
The universe is always one step beyond logic.



More information about the pygtk mailing list