[gtkmvc-users] How to launch one view from another view
Brought to you by:
cavada
From: haiyan qu <quh...@gm...> - 2011-11-22 00:41:14
|
Greeting, I am a beginner of pygtkmvc. So this may be a dumb question. I am trying to convert all pygtk-demo examples to pygtkmvc framework, I believe this will be my best practice for learning pygtkmvc. I have a problem when I am converting pygtk-demo->Dialog&MessageBox. This example involved 2 dialogs, parent dialog will launch child dialog. I created both parent and child dialog in Glade as “window1” and “window2” When I try to launch “window2” from the main window “window1”, I didn't get “window2”, instead I got a duplicate “window1”. Below are my 2 views from same .galde file, different top. class MyView1 (View): builder = "test.glade" top = 'window1' class MyView2 (View): builder = "test.glade" top = 'window2' When I click a button from view1, I want to launch view2. Unfortunately, view1 is opened again. def on_button_dialog_clicked(self, user_data): v2 = MyView2() c2 = MyControllerAdap2(self.model, v2) Any comment is very appreciated! example code (main.py and test.glade) is attached. demo.py is the original code from pygtk-demo (without using pygtkmvc framework) Thanks in advance and best regards! Q |