compiler knows if a widget allows children, and for those that do, which widget types can be created as their children.
If you try to include a child widget where it isn't allowed or supported, the UIL compiler generates an error message
and the compilation fails, which is one of the advantages of describing a user interface in UIL rather than with a
programming language like C.
You set widget resources, with the exception of callbacks, in a widget's argument subsection. This subsection in the
hello_main widget illustrates several typical resource settings. We used a symbolic constant to set the last two
resources so that it is easy to adjust the Form margins by changing the constant definition.
Callback resource settings are specified separately from other resources in the callbacks subsection of a widget
definition. The hello_main widget does not have any callbacks, but the PushButton does. Here's the relevant part
of its definition:
object hello : XmPushButton
{
! ... arguments ...
callbacks {
XmNactivateCallback = procedure quit ("Goodbye!");
};
};
This subsection sets the PushButton's activate callback to the quit() procedure declared earlier in the module. The
string argument "Goodbye!" is passed as client_data to the procedure when the callback is invoked. You'll see
how this value is used later when we explain registering callback procedures with Mrm.
The widget definitions, along with the value definitions and procedure declaration, are all there is to the "Hello,
World" module. ...