Button

Table of Contents

## NAME

XfwfButton

## DESCRIPTION

The XfwfButton widget is a simple button with a single call back activate_callback. Except for that callback, all resources are inherited from the XfwfLabel widget. Sub classes provide buttons of other, more specialized types. XfwfButton inherits its 3D frame from XfwfFrame, the loca tion specification resources from XfwfBoard and the multiline label from XfwfLabel.

The implementation is also very simple, since nearly all code is inherited from XfwfLabel. There are no new or rede fined methods. In fact, just six lines of actual code suf fice to implement the widget: Object Oriented Programming at its best!

Public variables
________________________________________________

|
  XfwfButton

| Name
  | Class | Type | Default | XtNactivate| XtCActivate| Callback| NULL | XtNenter | XtCEnter | Callback| NULL | XtNleave | XtCLeave | Callback| NULL | | | | |____________|_____________|__________|_________

XtNactivate
The activate is invoked from the activate action, which is normally bound to a mouse click. The call_data argu ment of the callbacks routines is filled with a pointer to the event that triggered the action.

XtNenter
The enter callback is invoked on an EnterNotify event.

XtNleave
The leave callback is invoked on an LeaveNotify event.

XtNframeWidth
The default frameWidth is set to 2 pixels.

XtNtraversalOn
In contrast to its superclass XfwfLabel, a button usu ally takes part in keyboard traversal.

_______________________________________________________________________ | XfwfLabel | Name | Class | Type | Default | XtNlabel | XtCLabel | String | NULL | XtNtablist | XtCTablist | String | NULL | XtNfont | XtCFont | FontStruct| XtDefaultFont | XtNforeground | XtCForeground | Pixel | XtDefaultForeground | XtNhlForeground| XtCHlForeground| Pixel | XtDefaultForeground | XtNalignment | XtCAlignment | Alignment | 0 | XtNtopMargin | XtCTopMargin | Dimension | 2 | XtNbottomMargin| XtCBottomMargin| Dimension | 2 | XtNleftMargin | XtCLeftMargin | Dimension | 2 | XtNrightMargin | XtCRightMargin | Dimension | 2 | XtNshrinkToFit | XtCShrinkToFit | Boolean | False | XtNrvStart | XtCRvStart | Int | 0 | XtNrvLength | XtCRvLength | Int | 0 | XtNhlStart | XtCHlStart | Int | 0 | XtNhlLength | XtCHlLength | Int | 0 | | | | |________________|_________________|____________|______________________

_____________________________________________________

|
  XfwfBoard

| Name
  | Class | Type | Default

| XtNabs_x
  | XtCAbs_x | Position | 0

| XtNrel_x
  | XtCRel_x | Float | "0.0"

| XtNabs_y
  | XtCAbs_y | Position | 0

| XtNrel_y
  | XtCRel_y | Float | "0.0" | XtNabs_width | XtCAbs_width | Position | 0 | XtNrel_width | XtCRel_width | Float | "1.0" | XtNabs_height| XtCAbs_height| Position | 0 | XtNrel_height| XtCRel_height| Float | "1.0"

| XtNhunit
  | XtCHunit | Float | "1.0"

| XtNvunit
  | XtCVunit | Float | "1.0" | XtNlocation | XtCLocation | String | NULL | | | | |______________|_______________|___________|_________

________________________________________________________________________________________

|
  XfwfFrame | Name | Class | Type | Default | XtNcursor | XtCCursor | Cursor | None | XtNframeType | XtCFrameType | FrameType | XfwfRaised | XtNframeWidth | XtCFrameWidth | Dimension | 0 | XtNouterOffset | XtCOuterOffset | Dimension | 0 | XtNinnerOffset | XtCInnerOffset | Dimension | 0 | XtNshadowScheme | XtCShadowScheme | ShadowScheme | XfwfAuto | XtNtopShadowColor | XtCTopShadowColor | Pixel | compute_topcolor | XtNbottomShadowColor | XtCBottomShadowColor | Pixel | compute_bottomcolor | XtNtopShadowStipple | XtCTopShadowStipple | Bitmap | NULL | XtNbottomShadowStipple| XtCBottomShadowStipple| Bitmap | NULL | | | | |_______________________|________________________|_______________|______________________

___________________________________________________________________________________

|
  XfwfCommon | Name | Class | Type | Default | XtNtraversalOn | XtCTraversalOn | Boolean | True | XtNhighlightThickness| XtCHighlightThickness| Dimension | 2 | XtNhighlightColor | XtCHighlightColor | Pixel | XtDefaultForeground | XtNhighlightPixmap | XtCHighlightPixmap | Pixmap | None | XtNnextTop | XtCNextTop | Callback | NULL | XtNuserData | XtCUserData | Pointer | NULL | | | | |______________________|_______________________|____________|______________________

_____________________________________________________________

|
  Composite

| Name
  | Class | Type | Default | XtNchildren | XtCChildren | WidgetList | NULL | insertPosition| XtCInsertPosition| XTOrderProc | NULL | numChildren | XtCNumChildren | Cardinal | 0 | | | | |_______________|___________________|______________|_________

______________________________________________________________________

|
  Core

| Name | Class | Type | Default

| XtNx
  | XtCX | Position | 0

| XtNy
  | XtCY | Position | 0

| XtNwidth
  | XtCWidth | Dimension | 0

| XtNheight
  | XtCHeight | Dimension | 0

| borderWidth
  | XtCBorderWidth | Dimension | 0

| XtNcolormap
  | XtCColormap | Colormap | NULL

| XtNdepth
  | XtCDepth | Int | 0 | destroyCallback | XtCDestroyCallback | XTCallbackList | NULL | XtNsensitive | XtCSensitive | Boolean | True

| XtNtm
  | XtCTm | XTTMRec | NULL | ancestorSensitive| XtCAncestorSensitive| Boolean | False | accelerators | XtCAccelerators | XTTranslations | NULL

| borderColor
  | XtCBorderColor | Pixel | 0 | borderPixmap | XtCBorderPixmap | Pixmap | NULL

| background
  | XtCBackground | Pixel | 0 | backgroundPixmap | XtCBackgroundPixmap | Pixmap | NULL | mappedWhenManaged| XtCMappedWhenManaged| Boolean | True

| XtNscreen
  | XtCScreen | Screen * | NULL | | | | |__________________|______________________|_________________|_________

Translations
By default, the activate action is bound to a mouse click and to the Enter key.

<Btn1Down>: set_shadow(sunken)

<Btn1Down>,<Btn1Up>: activate() set_shadow()

Button1<Leave>: set_shadow() leave()

<Key>Return: set_shadow(sunken) activate() set_shadow()

<EnterNotify>: enter()

<LeaveNotify>: leave()

enter

leave

Table of Contents

- NAME
- DESCRIPTION