Page: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|
Each of these widgets performs a specific user interface function. They are simple because they cannot have widget children-they may only be used as leaves of the widget tree. These widgets display information or take user input.
Command | A push button that, when selected, may cause a specific action to take place. This widget can display a multi-line string or a bitmap or pixmap image. |
Grip | A rectangle that, when selected, will cause an action to take place. |
Label | A rectangle that can display a multi-line string or a bitmap or pixmap image. |
List | A list of text strings presented in row column format that may be individually selected. When an element is selected an action may take place. |
Panner | A rectangular area containing a slider that may be moved in two dimensions. Notification of movement may be continuous or discrete. |
Repeater | A push button that triggers an action at an increasing rate when selected. This widget can display a multi-line string or a bitmap or pixmap image. |
Scrollbar | A rectangular area containing a thumb that when slid along one dimension may cause a specific action to take place. The Scrollbar may be oriented horizontally or vertically. |
Simple | The base class for most of the simple widgets. Provides a rectangular area with a settable mouse cursor and special border. |
StripChart | A real time data graph that will automatically update and scroll. |
Toggle | A push button that contains state information. Toggles may also be used as "radio Buttons" to implement a "one of many" or "zero or one of many" group of buttons. This widget can display a multi-line string or a bitmap or pixmap image. |
Home |
---|
Application header file | <X11/Xaw/Command.h> |
Class header file | <X11/Xaw/CommandP.h> |
Class | commandWidgetClass |
Class Name | Command |
Superclass | Label |
The Command widget is an area, often rectangular, that contains text or a graphical image. Command widgets are often referred to as "push buttons." When the pointer is over a Command widget, the widget becomes highlighted by drawing a rectangle around its perimeter. This highlighting indicates that the widget is ready for selection. When mouse button 1 is pressed, the Command widget indicates that it has been selected by reversing its foreground and background colors. When the mouse button is released, the Command widget's notify action is invoked, calling all functions on its callback list. If the pointer is moved off of the widget before the pointer button is released, the widget reverts to its normal foreground and background colors, and releasing the pointer button has no effect. This behavior allows the user to cancel an action.
When creating a Command widget instance, the following resources are retrieved from the argument list or from the resource database:
Name | Class | Type | Notes | Default Value |
accelerators | Accelerators | AcceleratorTable | NULL | |
ancestorSensitive | AncestorSensidve | Boolean | D | True |
background | Background | Pixel | XtDefaultBackground | |
backgroundPixtmap | Pixmap | Pixmap | XtUnspecifiedPixmap | |
bitmap | Bitmap | Pixmap | None | |
borderColor | BorderColor | Pixel | XtDefaultForeground | |
borderPixrnap | Pixmap | Pixmap | XtUnspecifiedPixmap | |
borderWidth | BorderWidth | Dirnension | 1 | |
callback | Callback | XtCallbackList | NULL | |
colormap | Colormlap | Colormlap | Parent's Colormlap | |
comerRoundPercent | ComerRoundPercent | Dimension | 25 | |
cursor | Cursor | Cursor | None | |
cursorNarme | Cursor | String | NULL | |
depth | Depth | int | C | Parent's Depth |
destroyCallback | Callback | XtCallbackList | NULL | |
encoding | Encoding | UnsignedChar | XawTextEncoding8bit | |
font | Font | XFontStruct | XtDefaultFont | |
foreground | Foreground | Pixel | XtDefaultForeground | |
height | Height | Dimension | A | graphic height+ 2 * internalHeight |
highlightThickness | Thickness | Dimension | A | 2(0 if Shaped) |
insensitdveBorder | Insensitive | Pixmap | GreyPixmap | |
internalHeight | Height | Dimension | 2 | |
internalWidth | Width | Dimension | 4 | |
international | International | Boolean | C | False |
justify | Justify | Justify | XtJustify Center (center) | |
label | Label | String | name of widget | |
leftBitmap | LeftBitmap | Bitmap | None | |
mappedWhenManaged | MappedWhenManaged | Boolean | True | |
pointerColor | Foreground | Pixel | XtDefaultForeground | |
pointerColorBackground | Background | Pixel | XtDefaultBackground | |
resize | Resize | Boolean | True | |
screen | Screen | Screen | R | Parent's Screen |
sensitive | Sensitive | Boolean | True | |
shapeStyle | ShapeStyle | ShapeStyle | Rectangle | |
translations | Translations | TransladonTable | See below | |
width | Width | Dimension | A | graphic width 2 * internalWidth |
x | Position | Position | 0 | |
y | Position | Position | 0 |
accelerators | A list of event to action bindings to be executed by this widget, even though the event occurred in another widget. (See the X Toolkit Intrinsics-C Language Interface for details). |
ancestorSensitive | The sensitivity state of the ancestors of this widget. A widget is insensitive if either it or any of its ancestors is insensitive. This resource should not be changed with XtSetValues, although it may be queried. |
background | A pixel value which indexes the widget's colormap to derive the background color of the widget's window. |
backgroundPixmap | The background pixmap of this widget's window. If this resource is set to anything other than XtUnspecifiedPixmap, the pixmap specified will be used instead of the background color. |
bitmap | A bitmap to display instead of the label. The default size of the widget will be just large enough to contain the bitmap and the widget's internal width and height. The resource converter for this resource constructs bitmaps from the contents of files. (See section 2.5.3, Bitmap Conversion, for details.) If this bitmap is one bit deep then the l's will be rendered in the fore ground color, and the O's in the background color. If bitmap has a depth greater than one, it is copied directly into the window. |
borderColor | A pixel value which indexes the widget's colormap to derive the border color of the widget's window. |
borderPixmap | The border pixmap of this widget's window. If this resource is set to anything other than XtUnspecifiedPixmap, the pixmap specified will be used instead of the border color. |
borderWidth | The width of this widget's window border. |
callback | A list of routines to be called when the notify action is invoked. |
colormap | The colormap that this widget will use. |
cornerRoundPercent | When a ShapeStyle of roundedRectangle is used, this resource controls the radius of the rounded corner. The radius of the rounded corners is specified as a percentage of the length of the shortest side of the widget. |
cursor | The image that will be displayed as the pointer cursor whenever it is in this widget. The use of this resource is deprecated in favor of cursorName. |
cursorName | The name of the symbol to use to represent the pointer cursor. This resource will override the cursor resource if both are specified. (See 2.5.1) |
depth | The depth of this widget's window. |
destroyCallback | All functions on this list are called when this widget is destroyed. |
encoding | The encoding method used by the value of the label resource. The value may be XawTextEncoding8bit or XawTextEncodingChar2b. When international is set to true this resource is not used. |
font | The text font to use when displaying the label, when the international resource is false. |
fontSet | The text font set to use when displaying the label, when the international resource is true. |
foreground | A pixel value which indexes the widget's colormap to derive the fore ground color of the widget's window. This color is also used to render all l's in a bitmap one plane deep. |
height | |
width | The height and width of this widget in pixels. |
highlightThickness | The thickness of the rectangle that is used to highlight the internal border of this widget, alerting the user that it is ready to be selected. The default value is 2 pixels if the shapeStyle is rectangle, and O Pixels (no highlighting) otherwise. |
insensitiveBorder | This pixmap will be tiled into the widget's border if the widget becomes insensitive. |
intemalHeight | |
intemalWidth | The minimum amount of space to leave between the graphic and the vertical and horizontal edges of the window. |
international | This is a boolean flag, only settable at widget creation time. A value of false signals the widget to use pre-R6 internationalization (specifically, the lack thereof), such as using fonts for displaying text, etc. A value of true directs the widget to act in an internationalized manner, such as utilizing font sets for displaying text, etc. |
justify | Specifies left, center, or right alignment of graphic within the widget. This resource may be specified with the values XtJustifyLeft, XtJustifyCenter, or XtJustifyRight. A converter is registered for this resource that will convert the following strings: left, right, and center.
This resource only has noticeable effect when the width of the widget is larger than necessary to display the graphic. Note that when the graphic is a multi-line label, the longest line will obey this justification while shorter lines will be left-justified with the longest one. |
label | Specifies the text string to be displayed in the widget's window if no bitmap is specified. The default is the name of this widget. Irregardless of the value of encoding or international, a single newline character (1 byte) will cause a line break. |
IeftBitmap | Specifies a bitmap to display to the left of the graphic in the widget's window. |
mappedWhenManaged | If this resource is True, then the widget's window will automatically be mapped by the Toolkit when it is realized and managed. |
pointerColor | A pixel value which indexes the widget's colormap to derive the foreground color of the pointer symbol specified by the cursorName resource. |
pointerColorBackground | A pixel value which indexes the widget's colommap to derive the background color of the pointer symbol specified by the cursor Name resource. |
resize | Specifies whether the widget should attempt to resize to its preferred dimensions whenever its resources are modified with XtSetValues. This attempt to resize may be denied by the parent of this widget. The parent is always free to resize the widget regardless of the state of this resource. |
screen | The screen on which this widget is displayed. This is not a settable resource. |
sensitive | Whether or not the toolkit should pass user events to this widget. The widget will not get input events if either ancestorSensitive or sensitive is False. |
shapeStyle | Nonrectangular widgets may be created using this resource. Nonrecangular widgets are supported only on a server that supports the Shape Extension. If Nonrectangular widgets are specified for a server lacking this extension, the shape is ignored and the widgets will be rectangular.
The following shapes are currently supported: XmuShapeRectangle, XmuShapeOval, XmuShapeEllipse, and XmuShapeRoundedRectan gle. A converter is registered for this resource that will convert the fool lowing strings: rectangle, oval, ellipse, and roundedRectangle. |
translations | The event bindings associated with this widget. |
x | |
y | The location of the upper left outside corner of this widget in its parent. |
The Command widget supports the following actions:
The following are the default translation bindings used by the Command widget:
<EnterWindow>: | highlight( ) |
<LeaveWindow>: | reset( ) |
<BtnlDown>: | set( ) |
<Btn1Up>: | notify( ) unset( ) |
The full list of actions supported by Command is:
highlight(condition) | Displays the internal highlight border in the color (foreground or background ) that contrasts with the interior color of the Command widget. The conditions WhenUnset and Always are understood by this action procedure. If no argument is passed, WhenUnset is assumed. |
unhighlight( ) | Displays the internal highlight border in the color (foreground or background) that matches the interior color of the Command widget. |
set( ) | Enters the set state, in which notify is possible. This action causes the button to display its interior in the foreground color. The label or bit map is displayed in the background color. |
unset( ) | Cancels the set state and displays the interior of the button in the background color. The label or bitmap is displayed in the foreground color. |
reset( ) | Cancels any set or highlight and displays the interior of the button in the background color, with the label or bitmap displayed in the foreground color. |
notify( ) | When the button is in the set state this action calls all functions in the callback list named by the callback resource. The value of the call_data argument passed to these functions is undefined. |
*Myapp*save.translations: #augment <Btn 1 Down>,<Btn lUp>: Save()
When a bitmap of depth greater that one (1) is specified the set(), unset(), and reset() actions have no effect, since there are no foreground and background colors used in a multi-plane pixmap. |
Home |
---|
Application header file | <X1 11/Xaw/Grip.h> |
Class header file | <X1 1/XawGripP.h> |
Class | gripWidgetClass |
Class Name | Grip |
Superclass | Simple |
The Grip widget provides a small rectangular region in which user input events (such as ButtonPress or ButtonRelease) may be handled. The most common use for the Grip widget is as an attachment point for visually repositioning an object, such as the pane border in a Paned widget.
3.2.1. Resources
When creating a Grip widget instance, the following resources
are retrieved from the argument list or from the resource database:
Name | Class | Type | Notes | Defaull Value |
accelerators | Accelerators | AcceleratoraTable | NULL | |
ancestorSensitive | ancestorSensitive | Boolean | D | True |
background | Background | Pixel | XtDefaultBackground | |
backgroundPixmap | Pixmap | Pixmap | XtUnspecifiedPixmap | |
borderColor | BorderColor | Pixel | XtDefaultForeground | |
borderPixmap | Pixmap | Pixmap | XtUnspecifiedPixmap | |
borderWidth | BorderWidth | Dimension | 0 | |
callback | Callback | Callback | NULL | |
colormap | Colormap | Colormap | Parent's Colormap | |
cursor | Cursor | Cursor | None | |
cursorNarme | Cursor | String | NULL | |
depth | Depth | int | C | Parent's Depth |
destroyCallback | Callback | XtCallbackList | NULL | |
foreground | Foreground | Pixel | XtDefaultForeground | |
height | Height | Dimension | 8 | |
insensitiveBorder | Insensitive | Pixmap | GreyPixmap | |
international | International | Boolean | C | False |
mappedWhenManaged | MappedWhenManaged | Boolean | True | |
pointerColor | Foreground | Pixel | XtDefaultForeground | |
pointerColorBackground | Background | Pixel | XtDefaultBackground | |
screen | Screen | Screen | R | Parent's Screen |
sensitive | Sensitive | Boolean | True | |
translations | Translations | TranslationTable | NULL | |
width | Width | Dimension | 8 | |
x | Position | Position | 0 | |
y | Position | Position | 0 |
accelerators | A list of event to action bindings to be executed by this widget, even though the event occurred in another widget. (See the X Toolkit Intrinsics-C Language Interface for details). |
ancestorSensitive | The sensitivity state of the ancestors of this widget. A widget is insensitive if either it or any of its ancestors is insensitive. This resource should not be changed with XtSetValues, although it may be queried. |
background | A pixel value which indexes the widget's colormap to derive the back ground color of the widget's window. |
backgroundPixmap | The background pixmap of this widget's window. If this resource is set to anything other than XtUnspecifiedPixmap, the pixmap specified will be used instead of the background color. |
borderColor | A pixel value which indexes the widget's colormap to derive the border color of the widget's window. |
borderPixmap | The border pixmap of this widget's window. If this resource is set to anything other than XtUnspecifiedPixmap, the pixmap specified will be used instead of the border color. |
borderWidth | The width of this widget's window border. |
callback | All routines on this list are called whenever the GripAction action routine is invoked. The call_data contains all information passed to the action routine. A detailed description is given below in the Grip Actions section. |
colormap | The colormap that this widget will use. |
cursor | The image that will be displayed as the pointer cursor whenever it is in this widget. The use of this resource is deprecated in favor of cursorName. |
cursorName | The name of the symbol to use to represent the pointer cursor. This resource will override the cursor resource if both are specified. (See 2.5.l) |
depth | The depth of this widget's window. |
destroyCallback | All functions on this list are called when this widget is destroyed. |
foreground | A pixel value which indexes the widget's colormap to derive the color used to flood fill the entire Grip widget. |
height | |
width | The height and width of this widget in pixels. |
insensitiveBorder | This pixmap will be tiled into the widget's border if the widget becomes insensitive. |
international | This is a boolean flag, only settable at widget creation time. While not utilized in this widget, it can and should be checked by any subclasses that have behavior that should vary with locale. |
mappedWhenManaged | If this resource is True, then the widget's window will automatically be mapped by the Toolkit when it is realized and managed. |
pointerColor | A pixel value which indexes the widget's colormap to derive the foreground color of the pointer symbol specified by the cursorName resource. |
pointerColorBackground | A pixel value which indexes the widget's colormap to derive the background color of the pointer symbol specified by the cursorName resource. |
screen | The screen on which this widget is displayed. This is not a settable resource. |
sensitive | Whether or not the toolkit should pass user events to this widget. The widget will not get input events if either ancestorSensitive or sensitive is False. |
translations | The event bindings associated with this widget. |
x | |
y | The location of the upper left outside corner of this widget in its parent. |
The Grip widget does not declare any default event translation
bindings, but it does declare a single action routine named GripAction. The client specifies an arbitrary event translation table, optionally giving parameters to the GripAction routine.
The GripAction routine executes the callbacks on the callback
list, passing as call_data a pointer to a XawGripCallData
structure, defined in the Grip widget's application header
file.
typedef struct_XawGripCallData { XEvent *event; String *params; Cardinal num_params; } XawGripCallDataRec, *XawGripCallData, GripCallDataRec, *GripCallData; /* supported for R4 compatibility */
In this structure, the evenl is a pointer to the input event that triggered the action. params and num_params give the string parameters specified in the translation table for the particular event binding.
The following is an example of a translation table that uses the GripAction:
<Btn l Down>: | GripAction(Press) |
<Btn l Motion>: | GripAction(move) |
<Btn 1 Up>: | GripAction(Release) |
For a complete description of the format of translation tables, see the X Toolkit Intrinsics-C Language Interface.
Home |
---|
Application header file | <Xl l/Xaw/Label.h> |
Class header file | <Xl l/Xaw/LabelP.h> |
Class | labelWidgetClass |
Class Name | Label |
Superclass | Simple |
A Label widget holds a graphic displayed within a rectangular region of the screen. The graphic may be a text string containing multiple lines of characters in an 8 bit or 16 bit character set (to be displayed with a font), or in a multi-byte encoding (for use with a fontset). The graphic may also be a bitmap or pixmap. The Label widget will allow its graphic to be left, right, or center justified. Normally, this widget can be neither selected nor directly edited by the user. It is intended for use as an output device only.
When creating a Label widget instance, the following resources are retrieved from the argument list or from the resource database:
Name | Class | Type | Notes | Defaull Value |
accelerators | Accelerators | AceeleralorTable | NULL | |
ancestorSensitive | ancestorSensitive | Boolean | D | True |
baekground | Background | Pixel | XtDefaultBackground | |
baekgroundPixmap | Pixmap | Pixmap | XtUnspeeifiedPixmap | |
bitmap | Bitmap | Pixmap | None | |
borderColor | BorderColor | Pixel | XtDefaultForeground | |
borderPixmap | Pixmap | Pixmap | XlUnspecifiedpixrnap | |
borderWidth | BorderWidth | Dimension | 1 | |
colormap | Colormap | Colormap | Parent's Colorrnap | |
cursor | Cursor | Cursor | None | |
cursorName | Cursor | String | NULL | |
depth | Deplh | int | C | Parent's Depth |
destroyCallback | Callback | XlCallbackLisl | NULL | |
encoding | Encoding | UnsignedChar | XawTextEncoding8bil | |
font | Font | XFontStruct | XtDefaultFont | |
fontset | FontSet | XfontSet | XtDefaultFontSet | |
foreground | Foreground | Pixel | XtDefaultForeground | |
height | Heighl | Dimension | A | graphic height + 2 * internalHeight |
insensitiveBorder | Insensitive | Pixmap | GreyPixmap | |
internalHeight | Height | Dimension | 2 | |
internalWidth | Width | Dimension | 4 | |
inlernaional | inlernaional | Boolean | C | False |
justify | Juslify | Juslify | XLluslifyCenter (center) | |
label | Label | Slring | name of widget | |
leflBitmap | LeflBitrnap | Bitmap | None | |
mappedWhenManaged | MappedWhenManaged | Boolean | True | |
poimerColor | Foreground | Pixel | XtDefaullForeground | |
poinlerColorBaekground | Background | Pixel | XtDefaultBackground | |
resize | Resize | Boolean | True | |
screen | Screen | Screen | R | Parent's Screen |
sensitive | Sensitive | Boolean | True | |
translations | Translations | TranslationTable | See above | |
width | Width | Dimension | A | graphic width + 2 * internalWidth |
x | Position | Position | 0 | |
y | Position | Position | 0 |
accelerators | A list of event to action bindings to be executed by this widget, even though the event occurred in another widget. (See the X Toolkit Intrinsics -C Language Interface for details). |
ancestorSensitive | The sensitivity state of the ancestors of this widget. A widget is insensitive if either it or any of its ancestors is insensitive. This resource should not be changed with XtSetValues, although it may be queried. |
background | A pixel value which indexes the widget's colormap to derive the back ground color of the widget's window. |
backgroundPixmap | The background pixmap of this widget's window. If this resource is set to anything other than XtUnspecifiedPixmap, the pixmap specified will be used instead of the background color. |
bitmap | A bitmap to display instead of the label. The default size of the widget will be just large enough to contain the bitmap and the widget's internal width and height. The resource converter for this resource constructs bit maps from the contents of files. (See section 2.5.3, Bitmap Conversion, for details.) If this bitmap is one bit deep then the 1's will be rendered in the foreground color, and the 0's in the background color. If bitmap has a depth greater than one, it is copied directly into the window. |
borderColor | A pixel value which indexes the widget's colormap to derive the border color of the widget's window. |
borderPixmap | The border pixmap of this widget's window. If this resource is set to anything other than XtUnspecifiedPixmap, the pixmap specified will be used instead of the border color. |
borderWidth | The width of this widget's window border. |
colormap | The colormap that this widget will use. |
cursor | The image that will be displayed as the pointer cursor whenever it is in this widget. The use of this resource is deprecated in favor of cursor Name. |
cursorName | The name of the symbol to use to represent the pointer cursor. This resource will override the cursor resource if both are specified. (See 2.5.1) |
depth | The depth of this widget's window. |
destroyCallback | All functions on this list are called when this widget is destroyed. |
encoding | The encoding method used by the value of the label resource. The value may be XawTextEncoding8bit or XawTextEncodingChar2b. When international is set to true this resource is not used. |
font | The text font to use when displaying the label, when the international resource is false. |
fontSet | The text font set to use when displaying the label, when the international resource is true. |
foreground | A pixel value which indexes the widget's colormap to derive the fore ground color of the widget's window. This color is also used to render all l's in a bitmap one plane deep. |
height | |
width | The height and width of this widget in pixels. |
insensitiveBorder | This pixmap will be tiled into the widget's border if the widget becomes insensitive. |
internalHeight | |
internalWidth | The minimum amount of space to leave between the graphic and the vertical and horizontal edges of the window. |
international | This is a boolean flag, only settable at widget creation time. A value of false signals the widget to use pre-R6 internationalization (specifically, the lack thereof), such as using fonts for displaying text, etc. A value of true directs the widget to act in an internationalized manner, such as utilizing font sets for displaying text, etc. |
justify | Specifies left, center, or right alignment of graphic within the widget. This resource may be specified with the values XtJustifyLeft, XtJustifyCenter, or XtJustifyRight. A converter is registered for this resource that will convert the following strings: left, right, and center. This resource only has noticeable effect when the width of the widget is larger than necessary to display the graphic. Note that when the graphic is a multi-line label, the longest line will obey this justification while shorter lines will be left-justified with the longest one. |
label | Specifies the text string to be displayed in the widget's window if no bit map is specified. The default is the name of this widget. Irregardless of the value of encoding or international, a single newline character ( 1 byte) will cause a line break. |
ieftBitmap | Specifies a bitmap to display to the left of the graphic in the widget's window. |
mappedWhenManaged | If this resource is True, then the widget's window will automatically be mapped by the Toolkit when it is realized and managed. |
pointerColor | A pixel value which indexes the widget's colormap to derive the foreground color of the pointer symbol specified by the cursorName resource. |
pointerColorBackground | A pixel value which indexes the widget's colormap to derive the background color of the pointer symbol specified by the cursorName resource. |
resize | Specifies whether the widget should attempt to resize to its preferred dimensions whenever its resources are modified with XtSetValues. This attempt to resize may be denied by the parent of this widget. The parent is always free to resize the widget regardless of the state of this resource. |
screen | The screen on which this widget is displayed. This is not a settable resource. |
sensitive | Whether or not the toolkit should pass user events to this widget. The widget will not get input events if either ancestorSensitive or sensitive is False. |
shapeStyle | Nonrectangular widgets may be created using this resource. Nonrectangular widgets are supported only on a server that supports the ShapeExtension.If nonrectangular widgets are specified for a server lacking this extension, the shape is ignored and the widgets will be rectangular. The following shapes are currently supported: XmuShapeRectangle, XmuShapeOval,XmuShapeEllipse, and XmuShapeRoundRectangle. A converter is registered for this resource that will convert the following string: rectangle, oval, ellipse, and roundedRectangle. |
translations | The event bindings associated with this widget. |
x | |
y | The location of the upper left outside corner of this widget in its parent. |
Home |
---|
Application header file | <Xl l/Xaw/List.h> |
Class header file | <X l l/Xaw/ListP.h> |
Class | listWidgetClass |
Class Name | List |
Superclass | Simple |
The List widget contains a list of strings formatted into rows and columns. When one of the strings is selected, it is highlighted, and the List widget's Notify action is invoked, calling all routines on its callback list. Only one string may be selected at a time.
3.4.1. Resources
When creating a List widget instance, the following resources
are retrieved from the argument list or from the resource database:
Name | Class | Type | Notes | Default Value |
accelerators | Accelerators | AcceleratorTable | NULL | |
ancestorSensitive | AncestorSensitive | Boolean | D | True |
background | Background | Pixel | XtDefaultBackground | |
backgroundPixmap | Pixrnap | Pixmap | XtUnspecifiedPixrnap | |
borderColor | BorderColor | Pixel | XtDefaultForeground | |
borderPixmap | Pixmap | Pixmap | XtUnspecifiedPixrnap | |
borderWidth | BorderWidth | Dimension | 1 | |
callback | Callback | Callback | NULL | |
colormap | Colormap | Colormap | Parent's Colormap | |
columnSpecify | Spacing | Dimension | 6 | |
cursor | Cursor | Cursor | XC_lefl_ptr | |
cursorName | Cursor | String | NULL | |
defaultColumns | Columns | int | 2 | |
depth | Depth | int | C | Parent's Depth |
destroyCallback | Callback | XtCallbackList | NULL | |
font | Font | FontStruct | XtDefaultFont | |
fontSet | FontSet | XFontSet | XtDefaultFontSet | |
forceColumns | Columns | Boolean | False | |
foreground | Foreground | Pixel | XtDefaultForeground | |
height | Height | Dimension | A | Enough space to contain the list |
insensitiveBorder | Insensitive | Pixmap | GreyPixmap | |
internalHeight | Height | Dimension | 2 | |
internalWidth | Width | Dimension | 4 | |
international | International | Boolean | C | False |
list | List | Pointer | name of widget | |
longest | Longest | int | A | 0 |
rnappedWhenManaged | MappedWhenManaged | Boolean | True | |
numberStrings | NumberStrings | int | A | computed for NULL terminated list |
pasteBuffer | Boolean | Boolean | False | |
pointerColor | Foreground | Pixel | XtDefaultForeground | |
pointerColorBackground | Background | Pixel | XtDefaultBackground | |
rowSpacing | Spacing | Dimension | 2 | |
screen | Screen | Screen | R | Parent's Screen |
sensitive | Sensitive | Boolean | True | |
translations | Translations | TransladonTable | See below | |
verticalList | Boolean | Boolean | False | |
width | Width | Dimension | A | Enough space to contain the list |
x | Position | Position | 0 | |
y | Position | Position | 0 |
accelerators | A list of event to action bindings to be executed by this widget, even though the event occurred in another widget. (See the X Toolkit Intrinsics-C Language Interface for details). |
ancestorSensitive | The sensitivity state of the ancestors of this widget. A widget is insensitive if either it or any of its ancestors is insensitive. This resource should not be changed with XtSetValues, although it may be queried. |
background | A pixel value which indexes the widget's colormap to derive the background color of the widget's window. |
backgroundPixmap | The background pixmap of this widget's window. If this resource is set to anything other than XtUnspecifiedPixmap, the pixmap specified will be used instead of the background color. |
borderColor | A pixel value which indexes the widget's colormap to derive the border color of the widget's window. |
borderPixmap | The border pixmap of this widget's window. If this resource is set to anything other than XtUnspecifiedPixmap, the pixmap specified will be used instead of the border color. |
borderWidth | The width of this widget's window border. |
callback | All functions on this list are called whenever the notify action is invoked. The call_data argument contains information about the element selected and is described in detail in the List Callbacks section. |
colormap | The colormap that this widget will use. |
columnSpacing | |
rowSpacing | The amount of space, in pixels, between each of the rows and columns in the list. |
cursor | The image that will be displayed as the pointer cursor whenever it is in this widget. The use of this resource is deprecated in favor of cursorName. |
cursorName | The name of the symbol to use to represent the pointer cursor. This resource will override the cursor resource if both are specified. (See 2.5.1) |
defaultColumns | The default number of columns. This value is used when neither the width nor the height of the List widget is specified or when forceColumns is True. |
depth | The depth of this widget's window. |
destroyCallback | All functions on this list are called when this widget is destroyed. |
font | The text font to use when displaying the list, when the international resource is false. |
fontSet | The text font set to use when displaying the list, when the international resource is true. |
forceColumns | Forces the default number of columns to be used regardless of the List widget's current size. |
foreground | A pixel value which indexes the widget's colormap to derive the color used to paint the text of the list elements. |
height | |
width | The height and width of this widget in pixels. |
insensitiveBorder | This pixmap will be tiled into the widget's border if the widget becomes insensitive. |
internal Height | |
internalWidth | The margin, in pixels, between the edges of the list and the corresponding edge of the List widget's window. |
list | An array of text strings displayed in the List widget. If numberStrings is zero (the default) then the list must be NULL terminated. If a value is not specified for the list, then numberStrings is set to 1, and the name of the widget is used as the list, and longest is set to the length of the name of the widget. The list is used in place, and must be available to the List widget for the lifetime of this widget, or until it is changed with XtSetValues or XawListChange. |
International | This is a boolean flag, only settable at widget creation time. A value of false signals the widget to use pre-R6 internationalization (specifically, the lack thereof), such as using fonts for displaying text, etc. A value of true directs the widget to act in an internationalized manner, such as utilizing font sets for displaying text, etc. |
longest | Specifies the width, in pixels, of the longest string in the current list. The List widget will compute this value if zero (the default) is specified. If this resource is set by hand, entries longer than this will be clipped to fit. |
mappedWhenManaged | If this resource is True, then the widget's window will automatically be mapped by the Toolkit when it is realized and managed. |
numberStrings | The number of strings in the current list. If a value of zero (the default) is specified, the List widget will compute it. When computing the number of strings the List widget assumes that the list is NULL terminated. |
pasteBuffer | If this resource is set to True then the name of the currently selected list element will be put into CUT_BUFFER_0. |
pointerColor | A pixel value which indexes the widget's colormap to derive the foreground color of the pointer symbol specified by the cursorName resource. |
pointerColorBackground | A pixel value which indexes the widget's colormap to derive the background color of the pointer symbol specified by the cursorName resource. |
screen | The screen on which this widget is displayed. This is not a settable resource. |
sensitive | Whether or not the toolkit should pass user events to this widget. The widget will not get input events if either ancestorSensitive or sensitive is False. |
translations | The event bindings associated with this widget. |
verticalList | If this resource is set to True then the list elements will be presented in column major order. |
x | |
y | The location of the upper left outside corner of this widget in its parent. |
3.4.2. List Actions
The List widget supports the following actions:
<BtnlDown>,<BtnlUp>: | Set( ) Notify( ) |
The full list of actions supported by List widget is:
Set( ) | Sets the list element that is currently under the pointer. To inform the user that this element is currently set, it is drawn with foreground and background colors reversed. If this action is called when there is no list element under the cursor, the currently set element will be unset. |
Unset( ) | Cancels the set state of the element under the pointer, and redraws it with normal foreground and background colors. |
Notify( ) | Calls all callbacks on the List widget's callback list. Information about the currently selected list element is passed in the call data argument (see List Callbacks below). |
3.4.3. List Callbacks
All procedures on the List widget's callback list will have a
XawListReturnStruct passed to them as call_data.
The structure is defined in the List widget's application
header file.
typedef struct_XawListReturnStruct { String string; /* string shown in the list. */ int list_index; /* index of the item selected. */ } XawListReturnStruct;
The list_index item used to be called simply index.
Unfortunately, this name collided with a global name defined on some operating systems, and had to be changed. |
w | Specifies the List widget. |
list | Specifies the new list for the List widget to display. |
niterns | Specifies the number of items in the list. If a value less than 1 is specified, list must be NULL terminated, and the number of items will be calculated by the List widget. |
longest | Specifies the length of the longest item in the list in pixels. If a value less than l is specified, the List widget will calculate the value. |
resize | Specifies a Boolean value that if True indicates that the List widget should try to resize itself after making the change. The constraints of the List widget's parent are always enforced, regardless of the value specified here. |
XawListChange will unset all list elements that are currently set before the list is actually changed. The list is used in place, and must remain usable for the lifetime of the List widget, or until list has been changed again with this function or with XtSetValues.
w | Specifies the List widget. |
item | Specifies an index into the current list that indicates the item to be highlighted. |
Only one item can be highlighted at a time. If an item is already highlighted when XawListHighlight is called, the highlighted item is unhighlighted before the new item is highlighted.
w | Specifies the List widget. |
3.4.7. Retrieving the Currently Selected Item
w | Specifies the List widget. |
Home |
---|
Application header file | <X11/Xaw/Panner.h> |
Class header file | <X11/Xaw/PannerP.h> |
Class | pannerWidgetClass |
Class Name | Panner |
Superclass | Simple |
A Panner widget is a rectangle, called the "canvas," on which another rectangle, the "slider," moves in two dimensions. It is often used with a Porthole widget to move, or "scroll," a third widget in two dimensions, in which case the slider's size and position gives feedback as to what portion of the third widget is visible.
The slider may be scrolled around the canvas by pressing, dragging, and releasing Buttonl; the default translation also enables scrolling via arrow keys and some other keys. While scrolling is in progress, the application receives notification through callback procedures. Notification may be done either continuously whenever the slider moves or discretely whenever the slider has been given a new location.
3.5.1. Resources
When creating a Panner widget instance, the following resources
are retrieved from the argument list or from the resource database:
Name | Class | Type | Notes | Defaull Value |
accelerators | Accelerators | AcceleralorTable | NULL | |
allowOff | allowOff | Boolean | False | |
ancestorSensitive | AnsestorSensitive | Boolean | D | True |
background | Background | Pixel | XtDefaultBackground | |
backgroundPixmap | Pixmap | Pixmap | XtUnspecifiedPixmap | |
backgroundStipple | BackgroundStipple | String | NULL | |
borderColor | BorderColor | Pixel | XtDefaultForeground | |
borderPixmap | Pixmap | Pixmap | XtUnspecifiedPixmap | |
borderWidth | BorderWidth | Dimension | 1 | |
canvasHeight | CanvasHeight | Dimension | 0 | |
canvasWidth | CanvasWidth | Dimension | 0 | |
colormap | Colormap | Colormap | Parent's Colormap | |
cursor | Cursor | Cursor | None | |
cursorName | Cursor | String | NULL | |
defaultScale | DeafaultScale | Dimension | 8 | |
depth | Depth | int | C | Parent's Depth |
destroyCallback | Callback | XlCallbackLisl | NULL | |
foreground | Foreground | Pixel | XtDefaultForeground | |
height | Height | Dimension | A | depends on orientation |
internalSpace | Internal Space | Dimension | 4 | |
international | International | Boolean | C | False |
lineWidth | LineWidth | Dimension | 0 | |
mappedWhenManaged | MappedWhenManaged | Boolean | True | |
pointerColor | Foreground | Pixel | XtDefaultForeground | |
pointerColorBackground | Background | Pixel | XtDefaultBackground | |
reportCallback | ReponCallback | Callback | NULL | |
resize | Resize | Boolean | True | |
rubberBand | RubberBand | Boolean | False | |
screen | Screen | Screen | R | Parent's Screen |
sensitive | Sensitive | Boolean | True | |
shadowColor | ShadowColor | Pixel | XtDefaultForeground | |
shadowThickness | shadowThickness | Dimension | 2 | |
sliderX | SlidorX | Position | 0 | |
sliderY | SliderY | Position | 0 | |
sliderHeight | SliderHeight | Dimension | 0 | |
sliderWidth | SliderWidth | Dimension | 0 | |
translations | Translations | TranslationTable | See below | |
width | Width | Dimension | A | depends on orientation |
x | Position | Position | 0 | |
y | Position | Position | 0 |
accelerators | A list of event to action bindings to be executed by this widget, even though the event occurred in another widget. (See the X Toolkit Intrinsics-C Language Interface for details). |
allowOff | Whether to allow the edges of the slider to go off the edges of the canvas. |
ancestorSensitive | The sensitivity state of the ancestors of this widget. A widget is insensitive if either it or any of its ancestors is insensitive. This resource should not be changed with XtSetValues, although it may be queried. |
background | A pixel value which indexes the widget's colormap to derive the background color of the widget's window. |
backgroundPixmap | The background pixmap of this widget's window. If this resource is set to anything other than XtUnspecifiedPixmap, the pixmap specified will be used instead of the background color. |
backgroundStipple | The name of a bitmap pattern to be used as the background for the area representing the canvas. |
borderColor | A pixel value which indexes the widget's colormap to derive the border color of the widget's window. |
borderPixmap | The border pixmap of this widget's window. If this resource is set to anything other than XtUnspecifiedPixmap, the pixmap specified will be used instead of the border color. |
borderWidth | The width of this widget's window border. |
canvasHeight | |
canvasWidth | The size of the canvas. |
colormap | The colormap that this widget will use. |
cursor | The image that will be displayed as the pointer cursor whenever it is in this widget. The use of this resource is deprecated in favor of cursorName. |
cursorName | The name of the symbol to use to represent the pointer cursor. This resource will override the cursor resource if both are specified. (See 2.5.1) |
defaultScale | The percentage size that the Panner widget should have relative to the size of the canvas. |
depth | The depth of this widget's window. |
destroyCallback | All functions on this list are called when this widget is destroyed. |
foreground | A pixel value which indexes the widget's colormap to derive the color used to draw the slider. |
height | |
width | The height and width of this widget in pixels. |
internalSpace | The width of internal border in pixels between a slider representing the full size of the canvas and the edge of the Panner widget. |
international | This is a boolean flag, only settable at widget creation time. While not utilized in this widget, it can and should be checked by any subclasses that have behavior that should vary with locale. |
lineWidth | The width of the lines in the rubberbanding rectangle when rubberbanding is in effect instead of continuous scrolling. The default is 0. |
mappedWhenManaged | If this resource is True, then the widget's window will automatically be mapped by the Toolkit when it is realized and managed. |
pointerColor | A pixel value which indexes the widget's colormap to derive the foreground color of the pointer symbol specified by the cursorName resource. |
pointerColorBackground | A pixel value which indexes the widget's colormap to derive the background color of the pointer symbol specified by the cursorName resource. |
reportCallback | All functions on this callback list are called when the notify action is invoked. See the Panner Actions section for details. |
resize | Whether or not to resize the panner whenever the canvas size is changed so that the defaultScale is maintained. |
rubberBand | Whether or not scrolling should be discrete (only moving a rubberbanded rectangle until the scrolling is done) or continuous (moving the slider itself). This controls whether or not the move action procedure also invokes the notify action procedure. |
screen | The screen on which this widget is displayed. This is not a settable resource. |
sensitive | Whether or not the toolkit should pass user events to this widget. The widget will not get input events if either ancestorSensitive or sensilive is False. |
shadowColor | The color of the shadow underneath the slider. |
shadowThickness | The width of the shadow underneath the slider. |
sliderX | |
sliderY | The location of the slider in the coordinates of the canvas. |
sliderHeight | |
sliderWidth | The size of the slider. |
translations | The event bindings associated with this widget. |
x | |
y | The location of the upper left outside corner of this widget in its parent. |
3.5.2. Panner Actions
The actions supported by the Panner widget are:
start() | This action begins movement of the slider. |
stop() | This action ends movement of the slider. |
abort() | This action ends movement of the slider and restores it to the position it held when the start action was invoked. |
move() | This action moves the outline of the slider (if the rubberBand resource is True) or the slider itself (by invoking the notify action procedure). |
page(xamount, yamount) | This action moves the slider by the specified amounts. The format for the amounts is a signed or unsigned floating-point number (e.g., +l.0 or -.5) followed by either p indicating pages (slider sizes), or c indicating canvas sizes. Thus, page(+0,+.5p) represents vertical movement down one-half the height of the slider and page(0,0) represents moving to the upper left corner of the canvas. |
notify() | This action informs the application of the slider's current position by invoking the reportCallback functions registered by the application. |
set(what, value) | This action changes the behavior of the Panner. The what argument must currently be the string rubberband and controls the value of the rubberBand resource. The value argument may have one of the values on, off, or toggle. |
<BtnlDown>: | start( ) |
<BtnlMotion>: | move( ) |
<Btn1Up>: | notify( ) stop( ) |
<Btn2Down>: | abort( ) |
<Key> KP_Enter : | set(rubberband, toggle) |
<Key>space: | page(+lp,+lp) |
<Key>Delete: | page(-lp,-lp) |
<Key>BackSpace: | page(-lp,-lp) |
<Key>Left: | page(-.5p,+0) |
<Key>Right: | page(+.5p,+0) |
<Key>Up: | page(+0,-.5p) |
<Key>Down: | page(+0,+.5p) |
<Key>Home: | page(0,0) |
panner | Specifies the Panner widget. |
client_data | Specifies the client data. |
report | Specifies a pointer to an XawPannerReport structure containing the location and size of the slider and the size of the canvas. |
Home |
---|
Contents | Previous Chapter | Part 2/Chapter 3 |