Name
moai.Set -- set value of a MOAI object attribute
Synopsis
moai.Set(id$, attr1$, val1$, ...)
Function
This function can be used to set the current value of one or more attributes in the MOAI object specified in id$. You have to pass the attribute name and desired new value for every attribute you want to modify. You can repeat these attribute/value pairs as often as you like to modify multiple attributes with just a single call to moai.Set(). 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 "S". 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.

If you have setup a notification on the attribute that you want to modify using this function, the notification will be triggered once you call moai.Set() on that attribute. If you do not want this behaviour, you can use the MOAI.NoNotify attribute to prevent a notification from being issued.

Inputs
id$
identifier of MOAI object to modify
attr1$
attribute whose value should be modified
val1$
new value for the attribute
...
you can repeat attribute/value pairs as often as you like
Example
moai.Set("my_listview", "active", 15)
The code above sets entry number 15 as currently active entry in the listview that has the identifier "my_listview" by setting the Listview.Active attribute.


moai.Set("my_listview", "nonotify", True, "active", 15)
This code does the same as the code above but prevents notifications from being issued by setting the MOAI.NoNotify attribute to True. This is useful if you need to distinguish between user selections in the listview and selections made programmatically using moai.Set().

Show TOC