next up previous contents
Next: The main code Up: The implementation without glade Previous: The view   Contents

The controller

The controller is the same that has been used for the glade-based version, a part from a further signal connection that is performed to connect the button ``clicked'' event to class method self.on_button_clicked. For this reason, class MyControllerNoGLade is derived from class MyController to reduce typing.

   
# This is file ctrl_no_glade.py
from ctrl_glade import MyController

class MyControllerNoGlade (MyController):
    def __init__(self, model):
        MyController.__init__(self, model)
        return

    def register_view(self, view):
        MyController.register_view(self, view)

        # connects the signals:
        self.view['button'].connect('clicked', self.on_button_clicked)
        return    
    
    pass # end of class



Roberto Cavada 2008-08-26