diff options
author | Nostalghia <b.vehikel@googlemail.com> | 2010-06-27 16:57:23 (GMT) |
---|---|---|
committer | Nostalghia <b.vehikel@googlemail.com> | 2010-06-27 16:57:23 (GMT) |
commit | 5dce05c339d2fc636b845d7c01d2103c565447f6 (patch) | |
tree | b467ca648fe2feb876705e47ecb86c31b3b2c59b /kandid.py | |
parent | 22d182db24861239a33806c4869b2d6cc7228d8b (diff) |
refactoring th code for page handling
Diffstat (limited to 'kandid.py')
-rw-r--r-- | kandid.py | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -21,6 +21,7 @@ import pygtk pygtk.require('2.0') import gtk gtk.gdk.threads_init() + import ka_debug import ka_controller import ka_widget @@ -45,7 +46,9 @@ class KandidApplication(object): def destroy(self, widget, data=None): """Application will be closed.""" ka_debug.info('Kandid application: destroy signal occurred') - self._controller.write_file(TESTMODEL) + population_controller = self._controller.find_page('PopulationController') + if population_controller is not None: + population_controller.write_file(TESTMODEL) self._controller.close() gtk.main_quit() @@ -58,19 +61,19 @@ class KandidApplication(object): # Create GUI # Create the main container main_view = gtk.HBox() - self._widget = ka_widget.KandidWidget(main_view) + self._widget = ka_widget.KandidWidget() + main_view.pack_start(self._widget.get_widget_tree()) self._window.add(main_view) # Create a controller to connect view and model - self._controller = ka_controller.KandidController( \ - self._widget.widget_tree, - TESTPATH) - self._controller.read_file(TESTMODEL) + self._controller = ka_controller.KandidController(self._widget, TESTPATH) + self._controller.create_pages() # Display everything self._window.set_default_size(1200, 800) - self._controller.autoconnect_events() self._window.show_all() -# self._controller.start_all_calculations() + population_controller = self._controller.find_page('PopulationController') + if population_controller is not None: + population_controller.read_file(TESTMODEL) def main(self): """ |