toolkit, the event field of this callback structure is NULL when the reason is XmCR_RESIZE. As a result, you
cannot use the event structure to provide you with the new dimensions of the widget. To query the widget's size, you
must use XtVaGetValues() or possibly XtQueryGeometry(). The event field is also NULL when the user
activates the button using the keyboard rather than the mouse.
XmCR_ACTIVATE
XmCR_ARM
XmCR_DISARM
XmCR_EXPOSE
XmCR_RESIZE
When the reason is XmCR_EXPOSE, the callback routine handles drawing the X Window System logo in the
DrawnButton. Since the widget takes care of drawing its own highlight and shadow, we have to be careful not to draw
over these areas.
Since all of the rendering in a DrawnButton is the responsibility of the application, you must decide whether you want
to render the graphics differently when the button is insensitive. Since the DrawnButton is subclassed from the Label
class, you can provide a XmNlabelPixmap and XmNlabelInsensitivePixmap if you like, but in this case
you might as well use a PushButton instead of a DrawnButton.
In Chapter 20, Signal Handling, we present an example that shows how DrawnButtons can be used to construct an
application manager. An application manager is a program that contains a set of icons, where each icon corresponds
to a program. When the user pushes one of the buttons, the corresponding program is run. The button deactivates itself
so that only one instance of each application can run at a time. There is no particular reason ...