For your GnomeApp example, you should not need to connect a handler to the
delete_event signal, as the default behaviour is to destroy() the window
(at which point, it will be removed from screen and your destroy signal
handler will be called). Does this change help?
You really only need to use the delete_event signal if you want to do
something special when the window is closed. For instance, the following
code may be used:
def delete_event(win, event):
dlg = GnomeDialog('Save changes?', STOCK_BUTTON_YES,
STOCK_BUTTON_NO, STOCK_BUTTON_CANCEL)
# fill in dialog ...
res = dlg.run_and_close()
if res == 0: # yes
save_document()
elif res == 2: # cancel
return TRUE # return true to ignore the delete_event
return FALSE # continue destroying window
win.connect('delete_event', delete_event)
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
On Fri, 22 Oct 1999, Jozsa Kristof wrote:
> On Fri, Oct 22, 1999 at 09:39:43AM +0800, James Henstridge wrote:
> > The run_and_close() routine creates another mainloop to run the dialog.
> > This mainloop will finish when the dialog is closed or one of the buttons
> > is pressed. You probably shouldn't connect a handler that calls
> > mainquit() to one of the dialog's widgets, as this may cause problems with
> > the run_and_close() function. Calling mainquit() outside of the
> > run_and_close() call should make the outer mainloop return though.
> >
> > James.
>
> okie. I guess this should work then this way:
>
> --
> from gnome.ui import *
> from gtk import *
> class hqWin(GnomeApp):
> def about(self, moo):
> GnomeAbout('a', '0', 'R', ['a'], "T").run_and_close()
> def __init__(self):
> GnomeApp.__init__(self)
> self.create_toolbar([UIINFO_ITEM_STOCK('Help', '',
> self.about, STOCK_PIXMAP_HELP)])
> hq= hqWin()
> hq.connect("destroy", mainquit)
> hq.connect("delete_event", mainquit)
> hq.show()
> mainloop()
> --
>
> but it still cant exit properly after cleaning up the main win and the dialog box
>
> Christopher
> --
> +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
> | Christopher Jozsa /V\ Veszprem Linux Users Group |
> | [EMAIL PROTECTED] /( )\ student of IT, Hungary |
> +-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
>
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]