next up previous contents
Next: A simple application Up: Observable Properties in details Previous: Types of Observable Properties   Contents

Special members for Observable Properties

Classes derived from Model, that exports OPs, have several special members. Advanced users might be interested can override some of them, but in general they should be considered as private members. They are explained here for the sake of completeness.

__properties__
A class (static) member that maps property names and initial values. This must be provided as a map by the user.

__derived_properties__
Automatically generated static member that maps the OPs exported by all base classes. This does not contain OPs that the class overrides.

_prop_property_name
This is an auto-generated variable to hold the property value. For example, a property called x will generate a variable called _prop_x.

get_prop_property_name
This public method is the getter for the property. It is automatically generated only if the user does not define one. This means that the user can change the behavior of it by defining their own method. For example, for property x the method is get_prop_x. This method gets only self and returns the corresponding property value.

set_prop_property_name
This public method is customizable like
get_prop_<property_name>. This does not return anything, and gets self and the value to be assigned to the property. The default auto-generated code also calls method gtkmvc.Model.notify_property_change to notify the change to all registered observers.

For further details about this topic see meta-classes PropertyMeta and
ObservablePropertyMeta from package support.


next up previous contents
Next: A simple application Up: Observable Properties in details Previous: Types of Observable Properties   Contents
Roberto Cavada 2008-08-26