
User interface of dialog.uil
27.5 Prototyping an Interface With UIL
The showuid program in Chapter 24, Creating a User Interface With UIL, provides a useful foundation for
prototyping a user interface. The program contains two simple callbacks: one for printing a message and one for
exiting the program. By adding a few more callbacks, we can make the program even more useful as a building block
for developing interfaces.
27.5.1 Managing Widgets
Most user interfaces consist of a main application window and several support windows or dialogs. Since dialogs are
frequently posted and unposted, we can make prototyping easier by writing callbacks that manage and unmanage
widgets. the source code shows these routines.
void
manage (w, client_data,call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
{
Widget target = (Widget) client_data;
XtManageChild (target);
}
void
unmanage (w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
{
Widget target = (Widget) client_data;
XtUnmanageChild (target);
}
When adding new callbacks, we also need to update the list of callbacks that the showuid application registers with
MrmRegisterNames(). With the addition of these two functions, the list is declared as follows:
static MrmRegisterArg callback_list[] = {
{ "quit", (XtPointer) quit },
27 Advanced UIL Programming27.5 Prototyping an Interface With UIL
736