1 from gtkmvc import Controller
4 from about import AboutCtrl
5 from views.about import AboutView
8 class ApplicationCtrl(Controller):
9 """Controller of the top-level window (application)"""
11 def __init__(self, model):
12 Controller.__init__(self, model)
15 def register_view(self, view):
16 """Creates treeview columns, and connect missing signals"""
17 Controller.register_view(self, view)
19 # connects the signals:
20 self.view['main_window'].connect('destroy', gtk.main_quit)
21 self.view['about_btn'].connect('clicked', self.on_tb_about_clicked)
22 self.view['quit_btn'].connect('clicked', self.on_tb_quit_clicked)
25 # -----------------------------------------------------
27 # -----------------------------------------------------
33 # -----------------------------------------------------
35 # -----------------------------------------------------
37 def on_tb_about_clicked(self, tb):
38 c = AboutCtrl(self.model.about)
40 v.run() # this runs in modal mode
43 def on_tb_quit_clicked(self, bt):
46 # -----------------------------------------------------
47 # observable properties
48 # -----------------------------------------------------