LessTif

LessTif Manual Page - Widget Classes

XmDrawnButton


[Resources] [Callbacks] [Inherited Resources] [Actions] [Translations] [Public Functions] [Usage] [Example] [See Also]

Synopsis

Widget Class xmDrawnButtonWidgetClass
Public Header <Xm/DrawnB.h>
Private Header <Xm/DrawnBP.h>
Class Hierarchy Core:: XmPrimitive:: XmLabel:: XmDrawnButton

Description

The DrawnButton is a simple drawable Window that supports PushButton-type behavior. It is used to create buttons with graphical faces. Because of its simple design, it is better suited to display dynamic graphical images than a PushButton with a Pixmap face.

The DrawnButton does not manage its own Expose and ConfigureNotify events. Like the DrawingArea widget, these events are handled with Expose and Resize callbacks.

In addition, the DrawnButton also supports an optional three-dimensional shadow border. This can be used to make the widget look like a PushButton widget.


Resources

New Resources

Name Type Default Access
XmNmultiClick unsigned char dynamic CSG
XmNpushButtonEnabled Boolean False CSG
XmNshadowType unsigned char XmSHADOW_ETCHED_IN CSG

XmNmultiClick
The multiClick resource specifies the action to be taken if the user clicks on the button twice within the timespan specified by the display`s multiclick time. Possible values are:

XmNpushButtonEnabled
The pushButtonEnabled resource specifies whether or not the widget displays a three-dimensional(shadow) border.

XmNshadowType
The shadowType resource specifies the type of three-dimensional border to be displayed when XmNpushButtonEnabled is set to True. Possible values are:


Inherited Resources

XmDrawnButton inherits resources from the following widget classes:

Callbacks

New Callback Resources

The Drawn Button widget defines the following new callback resources:

Name Reason
XmNactivateCallback XmCR_ACTIVATE
XmNarmCallback XmCR_ARM
XmNdisarmCallback XmCR_DISARM
XmNexposeCallback XmCR_EXPOSE
XmNresizeCallback XmCR_RESIZE

XmNactivateCallback
The activateCallback specifies a list of callback functions that is called when the widget is activated. The widget is activated by pressing and releasing BSelect on the widget.

XmNarmCallback
The armCallback specifies a list of callback functions that is called when the widget is armed. The widget is armed by pressing BSelect on the widget.

XmNdisarmCallback
The disarmCallback specifies a list of callback functions that is called when the widget is disarmed. The widget is disarmed by releasing BSelect on the widget. It is assumed that BSelect was just pressed on the widget.

XmNexposeCallback
The exposeCallback specifies a list of callbacks that is called when the widget receives an Expose event.

XmNresizeCallback
The resizeCallback specifies a list of callbacks that is called when the widget receives a Resize event.

Callback Structure

Under Construction
typedef struct
{
int     reason;
XEvent  *event;
Window  window;
int     click_count;
} XmDrawnButtonCallbackStruct;

Actions

Arm()

Activate()

Disarm()

ArmAndActivate()

Help()

EnterWindow()

LeaveWindow()


Translations

<EnterWindow>: EnterWindow()
<LeaveWindow>: LeaveWindow()
<Btn1Down>: Arm()
<Btn1Down>,<Btn1Up>: Activate() Disarm()
<Btn1Up>: Activate() Disarm()
<Btn1Down>(2+): MultiArm()
<Btn1Up>(2+): MultiActivate()
<Key>osfActivate: PrimitiveParentActivate()
<Key>osfCancel: PrimitiveParentCancel()
<Key>osfSelect: ArmAndActivate()
<Key>osfHelp: Help()
<Key>Return: PrimitiveParentActivate()
<Key>space: ArmAndActivate()

Public Functions and Macros


Usage

Under Construction

Creation Using XmCreateDrawnButton convenience function:

Widget drawnb = XmCreateDrawnButton(parent, "Less is Mo", NULL, 0);
XtManageChild(drawnb);
Creation Using XtVaCreateManagedWidget:
Widget drawnb = XtVaCreateManagedWidget(
"Less is Mo", 
xmDrawnButtonWidgetClass, 
parent,
NULL);

Examples

Under Construction

See Also

Core, XmPrimitive, XmLabel,
Go Back to Index
Go Back to Main Index
Last Update:Fri 8 Dec 08:36:11 1995