There are several possible ways to derive your model. All look the same to a Controller.
Bases: gtkmvc.observer.Observer
Class attribute. A list or tuple of name strings. The metaclass ObservablePropertyMeta uses it to create properties.
Value properties have to exist as an attribute with an initial value, which may be None.
Logical properties require a getter and may have a setter method in the class.
All observable properties accessible from this instance.
Return type: | frozenset of strings |
---|
Decorate a method as a logical property getter. Comes in two flavours:
Uses the name of the method as the property name. The method must not require arguments.
Takes a variable number of strings as the property name(s). The name of the method does not matter. The method must take a property name as its sole argument.
Returns true if given property name refers an observable property inside self or inside derived classes.
Send a notification to all registered observers.
args the arguments we just passed to meth_name.
res the return value of the method call.
Send a notification to all registered observers.
instance the object stored in the property.
meth_name name of the method we are about to call on instance.
Send a notification to all registered observers.
old the value before the change occured.
Emit a signal to all registered observers.
prop_name the property storing the Signal instance.
arg one arbitrary argument passed to observing methods.
Register given observer among those observers which are interested in observing the model.
Decorate a method as a logical property setter. The counterpart to getter(). Also comes in two flavours:
Uses the name of the method as the property name. The method must take one argument, the new value.
Takes a variable number of strings as the property name(s). The name of the method does not matter. The method must take two arguments, the property name and new value.
Unregister the given observer that is no longer interested in observing the model.
Bases: gtkmvc.model.Model, gtk.TextBuffer
Use this class as base class for your model derived by gtk.TextBuffer
Bases: gtkmvc.model.Model, gtk.ListStore
Use this class as base class for your model derived by gtk.ListStore
Bases: gtkmvc.model.Model, gtk.TreeStore
Use this class as base class for your model derived by gtk.TreeStore
A base class for models whose observable properties can be changed by threads different than gtk main thread. Notification is performed by exploiting the gtk idle loop only if needed, otherwise the standard notification system (direct method call) is used. In this model, the observer is expected to run in the gtk main loop thread.
Use this class as base class for your model derived by gtk.TextBuffer
Use this class as base class for your model derived by gtk.ListStore
Use this class as base class for your model derived by gtk.TreeStore