Programmer's Reference


Appendix E. Common widgets platform differences

Parts of the Common Widgets subsystem can behave differently depending on constraints of the platform (hardware, operating system, and window system). For example, Windows supports only one alignment for text in button widgets. Where possible, Common Widgets features are mapped to the closest features available on the platform.

The tables below identify the platform constraints of the Common Widgets subsystem. Blank cells indicate that the corresponding item is fully supported for the indicated platform.

Table 120. General constraints

Item DOS/Windows OS/2 PM X/MOTIF
Border width The borderWidth resource can only be 0 or 1 pixels. The borderWidth resource can only be 0 or 1 pixels.
Background and foreground color Only solid colors are supported. Colors are not dithered. Limited to the 20 system colors.


Table 121. Constraints on arrow button widgets

(CwArrowButton)
Item DOS/Windows OS/2 PM X/MOTIF
Sizing Displays the message 'Arrow too big' when the widget is grown such that the bitmap that is used to draw the arrow becomes larger than 64K. This does not happen on Windows 95.

Border width
The borderWidth resource is ignored.

Table 122. Constraints on button and label widgets

(CwLabel, CwPushButton, CwToggleButton, CwCascadeButton, CwDrawnButton)
Item DOS/Windows OS/2 PM X/MOTIF
Alignment The alignment resource is ignored for CwPushButton and CwToggleButton. The label is placed by the operating system. The alignment resource is ignored for CwPushButton and CwToggleButton. The label is placed by the operating system.
Margins The following resources affect only the total width and height of the widget, not the positioning of the label or pixmap inside the widget: marginBottom, marginHeight, marginLeft, marginRight, marginTop, marginWidth. The following resources affect only the total width and height of the widget, not the positioning of the label or pixmap inside the widget: marginBottom, marginHeight, marginLeft, marginRight, marginTop, marginWidth.
Default shadow width The showAsDefault resource can only be 0 or 1. The showAsDefault resource can only be 0 or 1.
Border width
The borderWidth resource is ignored.
As menu items The following are not supported: backgroundColor, foregroundColor, tab traversal and focus control (setInputFocus, navigationType, traverseOn). Geometry requests and the geometry values are undefined. The following methods do nothing: stacking order requests (bringToFront), event handlers (even though they can be hooked), deferRedraw:, and updateWidget. The following are not supported: backgroundColor, foregroundColor, tab traversal and focus control (setInputFocus, navigationType, traverseOn). Geometry requests and the geometry values are undefined. The following methods do nothing: stacking order requests (bringToFront), event handlers (even though they can be hooked), deferRedraw:, and updateWidget.
Color Cannot set backgroundColor or foregroundColor.

Focus A CwToggleButton with indicatorType XmONEOFMANY forces set to true when it takes focus.


Table 123. Constraints on combo-box widgets

(CwComboBox)
Item DOS/Windows OS/2 PM X/MOTIF
Event handlers Event handlers can be hooked on the combo-box widget but not on the children that implement the combo box. Event handlers can be hooked on the combo-box widget but not on the children that implement the combo box.
Editing When the comboBoxType resource is XmSIMPLE, the combo box is always editable. The editable resource has no effect. When the comboBoxType resource is XmSIMPLE, the combo box is always editable. The editable resource has no effect.
Default selection
When the comboBoxType resource is XmDROPDOWN and there is no initial string setting, the first item in the combo box is selected when the combo box is dropped.

Table 124. Constraints on list widgets

(CwList)
Item DOS/Windows OS/2 PM X/MOTIF
Selection policy XmSINGLESELECT behaves the same as XmBROWSESELECT. XmSINGLESELECT behaves the same as XmBROWSESELECT.
Size limit There is a limit on the number of list items that the list will display. There is a limit on the number of list items that the list will display.
Automatic scrolling Positioning the list (setting the top and bottom item) may not actually scroll the list. This is because only one blank line is allowed at the bottom of the list and, therefore, depending on the number of items, the height of the list, and the desired position, the list may not scroll. Positioning the list (setting the top and bottom item) may not actually scroll the list. This is because only one blank line is allowed at the bottom of the list and, therefore, depending on the number of items, the height of the list, and the desired position, the list may not scroll.
Scroll bars When created normally (not as a scrolled list), no scroll bars appear.

When created as a scrolled list, the vertical scroll bar is visible only when required.

The horizontal scroll bar is visible when the scrollHorizontal resource is true and the list contains an item that is wider than the width of the list.

When created normally (not as a scrolled list), a vertical scroll bar appears.

When created as a scrolled list, the vertical scroll bar is always visible.

The horizontal scroll bar is visible when the scrollHorizontal resource is true.


Border width
The widget is always displayed with a 1-pixel border.

Table 125. Constraints on main window widgets

(CwMainWindow)
Item DOS/Windows OS/2 PM X/MOTIF
Organization Must be created as the child of a shell. Must be created as the child of a shell.
Scroll bar limitations Scroll bar children have the following limitations: the help callback is ignored, tab traversal and focus control (setInputFocus, navigationType, traverseOn) are not supported, geometry requests are ignored, and the initial geometry values are undefined. The following methods do nothing: stacking order requests (bringToFront), event handlers (even though they can be hooked), deferRedraw:, and updateWidget. Scroll bar children have the following limitations: the help callback is ignored, tab traversal and focus control (setInputFocus, navigationType, traverseOn) are not supported, geometry requests are ignored, and the initial geometry values are undefined. The following methods do nothing: stacking order requests (bringToFront), event handlers (even though they can be hooked), deferRedraw:, and updateWidget.

Table 126. Constraints on menus and menu bar

(CwRowColumn with rowColumnType of XmMENUBAR, XmMENUPULLDOWN, or XmMENUPOPUP)
Item DOS/Windows OS/2 PM X/MOTIF
Types of child widgets Only CwLabel, CwToggleButton, CwSeparator, or CwCascadeButton can be added. Only CwLabel, CwToggleButton, CwSeparator, or CwCascadeButton can be added.
Help callback Not supported Not supported
Background color Not supported Not supported
Tab traversal and focus control (setInputFocus:, interceptEvents:, grabPointer:, ungrabPointer:, navigationType, traverseOn) Not supported Not supported
Geometry requests Geometry requests are ignored, and the initial geometry values are undefined. Geometry requests are ignored, and the initial geometry values are undefined.
Stacking order Stacking order requests (bringToFront) do nothing. Stacking order requests (bringToFront) do nothing.
Event handlers Can be hooked but do nothing. Can be hooked but do nothing.
Updating widgets The updateWidget method does nothing. The updateWidget method does nothing.
Ignored resources The following resources are ignored: adjustLast, borderWidth, entryAlignment, entryBorder, marginHeight, marginWidth, numColumns, orientation, packing, spacing. The following resources are ignored: adjustLast, borderWidth, entryAlignment, entryBorder, marginHeight, marginWidth, numColumns, orientation, packing, spacing.
Accelerator text with pixmap menu items When a child has a labelType of XmPIXMAP, its acceleratorText is not shown. When a child has a labelType of XmPIXMAP, its acceleratorText is not shown.
Drawn buttons CwDrawnButton children are not supported. CwDrawnButton children are not supported.
Separators The separatorType, orientation, and margin resources are ignored for CwSeparator children. The separatorType, orientation, and margin resources are ignored for CwSeparator children.

Table 127. Constraints on menu bar

(CwRowColumn with rowColumnType of XmMENUBAR)
Item DOS/Windows OS/2 PM X/MOTIF
Unmapping Unmapping the widget has the same visual effect as unmanaging. Unmapping the widget has the same visual effect as unmanaging.
Parent widget Can only be created as a child of a CwMainWindow. Can only be created as a child of a CwMainWindow. Can be created as a child of any composite or shell widget, but is usually a child of a CwMainWindow.

Table 128. Constraints on menu

(CwRowColumn with rowColumnType of XmMENUPULLDOWN or XmMENUPOPUP)
Item DOS/Windows OS/2 PM X/MOTIF
Redrawing The redraw and redraw:y:width:height: methods do nothing. The redraw and redraw:y:width:height: methods do nothing.

Table 129. Constraints on scale widget

(CwScale)
Item DOS/Windows OS/2 PM X/MOTIF
Event handlers Event handlers can be hooked on the scale widget but not on the children that implement the scale. Event handlers can be hooked on the scale widget but not on the children that implement the scale.

Table 130. Constraints on scrolled bar widget

(CwScrollBar)
Item DOS/Windows OS/2 PM X/MOTIF
Border width Ignored Ignored

Table 131. Constraints on scrolled window widget

(CwScrolledWindow)
Item DOS/Windows OS/2 PM X/MOTIF
Organization The work area must be a child of the scrolled window. The work area must be a child of the scrolled window. A CwDrawingArea is inserted between the scrolled window and the work area when scrolling policy is XmAUTOMATIC.
Scroll bar limitations Scroll bar children have the following limitations: the help callback is ignored, tab traversal and focus control (setInputFocus, navigationType, traverseOn) are not supported, geometry requests are ignored and the initial geometry values are undefined. The following methods do nothing: stacking order requests (bringToFront), event handlers (even though they can be hooked), deferRedraw:, and updateWidget. Scroll bar children have the following limitations: the help callback is ignored, tab traversal and focus control (setInputFocus, navigationType, traverseOn) are not supported, geometry requests are ignored and the initial geometry values are undefined. The following methods do nothing: stacking order requests (bringToFront), event handlers (even though they can be hooked), deferRedraw:, and updateWidget.

Table 132. Constraints on text widget

(CwText)
Item DOS/Windows OS/2 PM X/MOTIF
Highlight vs selection Highlight and selection are the same. It is not possible to set the highlight without affecting the selection. Highlight and selection are the same. It is not possible to set the highlight without affecting the selection.
Highlight appearance XmHIGHLIGHTSELECTED and XmHIGHLIGHT- SECONDARYSELECTED both appear as inverse text. XmHIGHLIGHTSELECTED and XmHIGHLIGHT- SECONDARYSELECTED both appear as inverse text.
Insertion vs selection Insertion and selection are the same. It is not possible to move the insertion point without affecting the selection. Insertion and selection are the same. It is not possible to move the insertion point without affecting the selection.
Insertion point The insertion point (cursorPosition, getInsertionPosition) is always answered as the beginning of the selection if the editMode is XmSINGLELINEEDIT. The insertion point (cursorPosition, getInsertionPosition) is always answered as the beginning of the selection if the editMode is XmSINGLELINEEDIT.
Visual appearance
The selection is hidden when the widget loses focus.
Background and foreground color
Only solid background colors are supported.

Table 133. Constraints on top-level shell and dialog shell

(CwTopLevelShell, CwDialogShell)
Item DOS/Windows OS/2 PM X/MOTIF
Window titles Centered Left Centered
Behavior of mwmDecorations resource
  1. A title bar is always included (MWMDECORTITLE).
  2. If MWMDECORMAXIMIZE or MWMDECORMINIMIZE is set, MWMDECORRESIZEH is added.
  3. If a menu bar is added to a shell that has MWMDECORBORDER, Windows does not paint the shell properly.
No title bar is included unless MWMDECORTITLE is set. A title bar is included if any one of the following is set: MWMDECORTITLE, MWMDECORMENU, MWMDECORMINIMIZE, or MWMDECORMAXIMIZE.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]