Hi,
Sorry for the noise. I've got the answers from the FAQs.
Cheers,
Ionutz
Ionutz Borcoman wrote:
Hi,
My app has 2 windows: - the main window and - the configuration (preferences) window
I have designed them both with glade and SimpleGladeApp.py ( http://primates.ximian.com/~sandino/python-glade/ ).
The configuration window has 2 buttons: an OK button and a Cancel one.
How should I display the configuration and how should I handle the OK/Cancel/ESC key/closing the window from the WM ?
Is there a recipe for this?
What I want is to show the configuration window and block the main execution line till the user closes the preferences window by pressing the OK or Cancel buttons, ESC key or by clicking on 'X' from the window border. When this happens, the preferences window should dissapear and the main program should still be able to read the data entered by the user.
What are the differences when I also have an 'Apply' button? How do I do the above without blocking the main window? Is this possible without coupling the preferences window with the main one too much?
I have attached the complete code to the email.
What I do now is like this:
class Windowmain(SimpleGladeApp):
...
def new(self): self.preferences = Windowpreferences() self.setWindowModal(self.getWindow(), \ self.preferences.getWindow())
...
def setWindowModal(self, parentWindow, childWindow): # use this to really show it as modal childWindow.set_modal(gtk.TRUE) childWindow.set_transient_for(parentWindow)
...
def on_btnPreferences_clicked(self, widget, *args): self.preferences.windowPreferences.show()
...
class Windowpreferences(SimpleGladeApp): ... def on_btnOK_clicked(self, widget, *args): self.windowPreferences.hide()
def on_btnCancel_clicked(self, widget, *args): self.windowPreferences.hide()
...
Is this ok? Is there a better way?
TIA,
Ionutz
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
