The result is saved in pygtkmvc-example.glade.
The view is represented by class MyView, that derives from class View provided by gtkmvc. The class View can be thought as a container that holds a set of widgets, and may associate each widget with a string name. When a glade file is used to build the view, each widget will be associated automatically inside the view with the corresponding name occurring in the glade file.
Moreover, each View instance is connected to a corresponding Controller, and when built from a glade file, methods inside the Controller will be scanned to try to connect automatically all signals declared in the glade file.
from gtkmvc.model import Model
# This is file model.py
from gtkmvc.view import View
class MyView (View):
def __init__(self, ctrl):
View.__init__(self, ctrl, 'pygtkmvc-example.glade')
return
pass # end of class
Class MyView calls simply View's class constructor from within its constructor, by passing the Controller instance which it belongs to, and the glade file name. All the hard work is carried out by class View.