}
}
switch (reason) {
case EDIT_CUT :
result = XmTextCut (text_edit, when);
break;
case EDIT_COPY :
result = XmTextCopy (text_edit, when);
break;
case EDIT_PASTE :
result = XmTextPaste (text_edit);
case EDIT_CLEAR :
XmTextClearSelection (text_edit, when);
break;
}
if (result == False)
XmTextSetString (text_output, "There is no selection.");
}
void
popdown_cb (w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
{
XtUnmanageChild (w);
}
void
register_widget (w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
{
Widget *w_ptr = (Widget *) client_data;
*w_ptr = w;
}
In order to create the interface that we defined in UIL, the application must use Mrm. Like any other application that
uses Mrm, this application calls MrmInitialize(), MrmOpenHierarchyPerDisplay(), and
MrmFetchWidget(). It also registers its callbacks and some global widget variables with
MrmRegisterNames(). While it is possible to register both types of data with one call, we use two separate calls
to distinguish between the two types of data. We create the main window of the application in main() and leave the
creation of the dialogs until they are needed.
26.2.1 Widget IDs
When you create an interface by calling the Motif creation functions directly, you get the ID of each widget that you
create. With Mrm, many widgets are created with a single call, and all you get back is the ID of the widget at the top
of the hierarchy. In most cases, application programs need the ...