views:

22

answers:

1

I need to open a new window from my applications main window. This new window need to be modal, I need to be able to get a result from the modal window based on user interaction with it.

I have figured out how to make the window modal. But I can't figure out how to return a result from the modal window and pass it back to the main window when user close the modal window.

+1  A: 

You probably want to make your window a gtk.Dialog and launch it via the run() method. This is designed to do exactly what you are looking for.

See pygtk docs for gtk.Dialog.run

Bill Gribble
Dialog is a good option although I am not so keen having the default ok and cancel button that comes with a dialog. I have decided to implement an observer pattern to observe changes into the underlying data that the user modify in the modal window, and notify the main window of any changes.
zfranciscus