next up previous contents
Next: A widgets container Up: Views Previous: Views   Contents

Constructor

The View constructor is quite much complicated:

 
def __init__(self, controller, glade_filename=None,
             glade_top_widget_name=None, parent_view=None, 
             register=True)

glade_filename
can be either a string or a list of strings. In any case each provided string represents the file name of a Glade file. Typically each glade file contains a tree of (named) widgets.

glade_top_widget_name
can be a string or a list of strings. Each string provided is associated to the parameter glade_filename content, and represent the name of the widget in the widgets tree hierarchy to be considered as top level. This let the user to select single parts of the glade trees passed through parameter glade_filename.

parent_view
is the view instance to be considered parent of self. Generally this parameter is None.

register
is a flag used to delay view's registration to the controller. If your derived view class adds some widgets ``manually'' by creating them on the fly (see 5.4.2), you want to delay the view registration until all widgets have been actually created. Since the View's constructor must be called at the beginning of your derived view class constructor, you can avoid the View constructor calling Controller.register_view by setting this flag to False. After user's view class constructor has built all the widgets, it is responsible for calling Controller.register_view to perform the registration. (This is definitely more complicated to explain than to understand... examples show how delayed registration can be used.)


next up previous contents
Next: A widgets container Up: Views Previous: Views   Contents
Roberto Cavada 2008-08-26