If you remove the line:
  win.connect("delete_event", mainquit)
Does it make any difference?  When the WM decoration is used to close the
window, the default action will be taken (ie. destroy the widget), and the
mainquit will be executed anyway.

The call to create a GnomeAbout() widget and call run_and_close() displays
the dialog application modal and waits til a dialog button is pressed or
the window is closed.  (this is documented in the gnome-libs documentation
about gnome_dialog_run and gnome_dialog_run_and_close).

If you don't want the GnomeAbout widget to be modal, use the following:
  about = GnomeAbout(...)
  about.set_close(TRUE)   # close the dialog when a button is pressed
  about.show()

The dialog will be destroyed when the user closes it, and you don't have
to worry about it.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On Sun, 24 Oct 1999, Jozsa Kristof wrote:

> OK, I've tried to simplify the problem as much as I could, I'll try to show
> what the root of the problem seems to be. (I've used GtkWindow as the main
> window here not GnomeApp as previously, but it's the same effect). 
> 
> I open a subwindow or a Gnome About box from the main window (uncommenting
> the right line). If I open it using the button, it shows up. Then I close
> the main window using the window manager (destroy signal is used I guess so
> mainquit will start). If the opened window was the GtkWindow(), both will
> close and the program returns. If the Gnome AboutBox was opened, both
> window will close again and the code 'hangs', I do not get back the prompt;
> it has to be killed to return.
> 
> --
> from gnome.ui import *
> from gtk import *
> def butt(w, e=None):
> #   this one cant be cleaned:
> #        GnomeAbout('a', '0', 'R', ['a'], "T").run_and_close()
> #   this one works ok:      
>        GtkWindow().show()
> class mwin(GtkWindow):
>         def __init__(self):
>                 GtkWindow.__init__(self)
>                 box = GtkVBox()
>                 self.add(box)
>                 box.show()
>                 b = GtkButton("Test Dialog")
>                 b.connect("clicked", butt)
>                 box.add(b)
>                 b.show()
> win= mwin()
> win.connect("destroy", mainquit)
> win.connect("delete_event", mainquit)
> win.show()
> mainloop()
> --
> Soz for the much hassle I cause with this thread, I'm just completely lost
> on this prob :(
> 
> 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]

Reply via email to