next up previous
Next: A simple application Up: Observable Properties in details Previous: Observable Properties in details

Special members for Observable Properties

Classes derived from Model, that exports OPs, have several special members. Advanced user might be interested can override some of them, but in general they should be considered as private members.

__properties__
A class (static) member that maps property names and intial 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 autogenerated 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 behaviour 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 autogenerated code also calls method gtkmvc.Model.notify_property_change to notify the change to all registered observers.

For further details about this topic see metaclasses PropertyMeta and ObservablePropertyMeta from package support.


next up previous
Next: A simple application Up: Observable Properties in details Previous: Observable Properties in details
Roberto Cavada 2004-11-16