A button widget holding this trait can change its appearance to show that it is the default button
Format
#include <Xm/TakesDefT.h> typedef struct { int version; XmTakesDefaultNotifyProc showAsDefault; } XmTakesDefaultTraitRec, *XmTakesDefaultTrait; void (*XmTakesDefaultNotifyProc)WidgetXtEnum
DESCRIPTION
You will use the XmQTtakesDefault trait if you are writing a PushButton-style primitive widget or a DialogBox-style manager widget.
A DialogBox widget displays several PushButton-style children. For example, a typical DialogBox widget might display three PushButton widgets: an OK button, a Cancel button, and a Help button. One of these PushButton-style children should be the default button. The default button is the PushButton-style child that is activated when the user presses Return anywhere in the widget. (The parent_process method of the DialogBox is responsible for detecting the activation event.)
A PushButton-style widget must be capable of altering its appearance to show that it is the default choice. Most PushButton-style widgets do this by highlighting their borders in a special way.
If you are writing a PushButton-style widget, then your widget should hold the XmQTtakesDefault trait. This trait announces to DialogBox widgets that the child is capable of changing its appearance to show that it is the default choice. Conversely, if you are writing a DialogBox widget, then your DialogBox widget should examine its button children for this trait.
The following standard Motif primitives hold this trait:
In addition, the ExmCommandButton demonstrates how to install this trait and how to define a showAsDefault trait method.
The following standard Motif managers examine their children widgets for this trait and call the showAsDefault trait method:
void showAsDefaultWidget childWidgetXtEnum state
Every PushButton-style widget holding the XmQTtakesDefault trait must provide a showAsDefault trait method. The DialogBox that manages the PushButton-style widgets will call the XmQTtakesDefault trait method, each time passing a different value of state. The typical sequence of calls from the DialogBox manager is as follows:
XmDEFAULT_FORGET resets the visual appearance of a child widget so that it looks as it did prior to the XmDEFAULT_READY call.
RELATED
XmBulletinBoard(3), XmPushButton(3), and ExmCommandButton(3).