Hi, You should check out this great tutorial first: http://www.moeraki.com/pygtktutorial/pygtktutorial/index.html
You'll see that the easiest way to achieve this is to create a class where you initialise all your windows/dialogs (and you hold a reference to all of them) and another one where you handle all the events. From the event_handler (on_bla_button_clicked) you can then call methods which are going to give you references to these windows/dialogs: win1=main.get_window1() win2=main.get_window2() win1.show() win2.hide() After you get this running, you can go into more advanced way of managing this, like you'll find here: http://www.pygtk.org/articles.html And this nice FAQ has a few great tricks: http://www.async.com.br/faq/pygtk/index.py?req=all I'm finishing the development of such an application using over 35 windows. All running like a stack. It's a great experience and (I believe) it works great!! I'm using Glade though... -- Pierre On Thu, 2004-03-11 at 20:38, aviad cohen wrote: > hello everyone > i have a question about dialog/pop-up windows > > i'm trying to write a program that would show a menu of items. > when the user opens an item (meanning clicks on the button) > the main window would hide ( self.window.hide() ) and a new window > would open instead . > > when the user finished with the child window and press the "x" button > the window would then be closed and the main (previous) window would be > shown > again (self.window.show) > > some time ago i did this task with action-listener (using java) > or post-messege (using c++ and mfc) > > my REAL problem is to understand if this structure would be > dialog based like or open a new window new windows. > > i wrote an eample code: > . > file main1.py: > ------------------ > import gtk > import another_file_module > > class main1(gtk.Window): > def __init__ ... > > def clicked_on_button > new_win=another_file_module.main_1() > new_win.show_all() > self.window.hide() > > file another_file_module.py > -------------------------------------- > > import gtk > class main_1(gtk.Window): > def __init__ : > . > . > gtk.Window.__init__(self) > self.connect('destroy') -> what should i write here in order to close > this window and show the main1 > window again > . > . > > > thanks > aviad > _______________________________________________ > pygtk mailing list [EMAIL PROTECTED] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
signature.asc
Description: This is a digitally signed message part
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
