Global Events
Right-click the Events node and choose Event to add an event to an application. An event listens for a change in a running application. If a change occurs, it runs a sequence of commands. In the figure below, when the value of the Boolean variable specserverdir is changed, a local method onEvent is run.
Note that since this type of event has global scope and is not associated with a particular form, the full path: /form1/graphics1 needs to be used if referencing graphics objects.
The following two sections describe the options available in the Settings window of an event.
Source For Data Change Event
This section presents a filtered view of the tree from the Application Builder window. The nodes shown represent data or have children that do.
You can extend the list of available data nodes by clicking on the Switch to Model Builder and Activate Data Access button in the header of the section Source For Data Change Event.
For more information, see Data Access in the Method Editor.
Note that Explicit selections are also allowed as Source for Data Change Event. This allows a command sequence or a method to be run when the user clicks a geometry object, domain, face, edge, or point. The figure below shows a dialog for a global event that opens a form panel as a dialog when the user changes the contents of the Explicit selection named Outlet Boundaries.
Choose Commands to Run
In the Settings window for an Event, the section Choose Commands to Run is similar to that of a button and allows you to define a sequence of commands (which may include methods). For more information, see Button and Item.