moai.Notify(id$, attr$, enable)
attr$
in the MOAI object specified in id$
. You have to pass the attribute name and
a boolean flag that indicates whether you want to enable or disable notifications
on that attribute. Attribute names and object IDs are case insensitive,
i.e. it does not matter if you use upper or lower case characters for them.
The attributes that you can use with this function depend on the class of the specified MOAI object. Have a look at the class reference to see what attributes are supported by the different MOAI classes. In order to use an attribute with this function, it needs to have an applicability of "N". Attributes of Area class and MOAI class can be used on almost all other classes because the Area and MOAI classes act as superclasses for most of the other classes.
Once you have setup a notification on a certain object attribute, you can listen
to these events by installing a RapaGUI event handler callback using the
InstallEventHandler()
Hollywood function. See Notifications for details.
Please note that notifications can also be setup in the XML GUI declaration by
using the Notify
attribute. See Notifications for details.
True
to add a notification or False
to remove notification from this objectmoai.Notify("my_listview", "active", True)The code above installs a notification that triggers whenever the Listview.Active attribute changes in the listview that has the identifier "my_listview".