Re: [pygtk] Help with modal in Gtk::FileChooserDialog
Ter, 2005-12-13 às 04:04 +0100, dannym escreveu: > Hi, > > Am Donnerstag, den 01.12.2005, 12:23 + 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 <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> The universe is always one step beyond logic. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] Help with modal in Gtk::FileChooserDialog
Hi, Am Donnerstag, den 01.12.2005, 12:23 + 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) cheers, Danny ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] Help with modal in Gtk::FileChooserDialog
On Mon, 2005-11-28 at 22:47 +0100, dannym wrote: > Hi, > > Am Montag, den 28.11.2005, 15:47 -0500 schrieb Graham Ashton: > > On Monday 28 November, dannym wrote: > > > > > Usually you just use a modal event loop: > > > > > > dialog = gtk.FileChooserDialog() > > > answer = dialog.run() # hangs around until dialog is closed > > > del dialog > > > > Hi. Wouldn't it be better to say: > > > > dialog.destroy() > > > > instead of > > > > del dialog > > > > ? > > > > It was a long time ago that I did looked into this, but I found that > > in order to avoid memory leaks in long running processes that > > created/destroyed a lot of widgets, I had to explicitly call destroy() > > myself. I confess I'm not even sure if del calls it for you... > > I have no idea. My gut feeling says that exactly the same should happen > when you del it manually than what would happen if it were just gc'ed > after you closed it. > > However, your scenario is entirely possible too (i.e. gtk_object_destroy > is never called. Note that gtk_object_destroy is merely a method that > emits a signal "destroy" to which others can connect and make sure that > they don't hold a reference to the widget anymore, which would have > caused it to idle around indefinitely, as an immortal) > > Would be worth testing .. care to test? :) 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?... -- Gustavo J. A. M. Carneiro <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> The universe is always one step beyond logic ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] Help with modal in Gtk::FileChooserDialog
Hi, Am Montag, den 28.11.2005, 15:47 -0500 schrieb Graham Ashton: > On Monday 28 November, dannym wrote: > > > Usually you just use a modal event loop: > > > > dialog = gtk.FileChooserDialog() > > answer = dialog.run() # hangs around until dialog is closed > > del dialog > > Hi. Wouldn't it be better to say: > > dialog.destroy() > > instead of > > del dialog > > ? > > It was a long time ago that I did looked into this, but I found that > in order to avoid memory leaks in long running processes that > created/destroyed a lot of widgets, I had to explicitly call destroy() > myself. I confess I'm not even sure if del calls it for you... I have no idea. My gut feeling says that exactly the same should happen when you del it manually than what would happen if it were just gc'ed after you closed it. However, your scenario is entirely possible too (i.e. gtk_object_destroy is never called. Note that gtk_object_destroy is merely a method that emits a signal "destroy" to which others can connect and make sure that they don't hold a reference to the widget anymore, which would have caused it to idle around indefinitely, as an immortal) Would be worth testing .. care to test? :) cheers, Danny ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] Help with modal in Gtk::FileChooserDialog
On Monday 28 November, dannym wrote: > Usually you just use a modal event loop: > > dialog = gtk.FileChooserDialog() > answer = dialog.run() # hangs around until dialog is closed > del dialog Hi. Wouldn't it be better to say: dialog.destroy() instead of del dialog ? It was a long time ago that I did looked into this, but I found that in order to avoid memory leaks in long running processes that created/destroyed a lot of widgets, I had to explicitly call destroy() myself. I confess I'm not even sure if del calls it for you... -- Graham Ashton ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] Help with modal in Gtk::FileChooserDialog
Hi, Am Dienstag, den 22.11.2005, 14:37 -0500 schrieb Thierry Lam: > > > Does anyone know how to set modal to True for Gtk::FileChooserDialog? Usually you just use a modal event loop: dialog = gtk.FileChooserDialog() answer = dialog.run() # hangs around until dialog is closed del dialog > > > > Thanks > > Thierry cheers, Danny > > ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/