XmMessageBox(library call) XmMessageBox(library call)
NAME [Toc] [Back]
XmMessageBox - The MessageBox widget class
SYNOPSIS [Toc] [Back]
#include <Xm/MessageB.h>
DESCRIPTION [Toc] [Back]
MessageBox is a dialog class used for creating simple message dialogs.
Convenience dialogs based on MessageBox are provided for several
common interaction tasks, which include giving information, asking
questions, and reporting errors.
A MessageBox dialog is typically transient in nature, displayed for
the duration of a single interaction. MessageBox is a subclass of
BulletinBoard and depends on it for much of its general dialog
behavior.
The default value for XmNinitialFocus is the value of
XmNdefaultButton.
A typical MessageBox contains a message symbol, a message, and up to
three standard default PushButtons: OK, Cancel, and Help. It is laid
out with the symbol and message on top and the PushButtons on the
bottom. The Help button is positioned to the side of the other push
buttons. You can localize the default symbols and button labels for
MessageBox convenience dialogs.
The user can specify resources in a resource file for the gadgets
created automatically that contain the MessageBox symbol pixmap and
separator. The gadget names are Symbol and Separator.
A MessageBox can also be customized by creating and managing new
children that are added to the MessageBox children created
automatically by the convenience dialogs. In the case of
TemplateDialog, only the separator child is created by default. If
the callback, string, or pixmap symbol resources are specified, the
appropriate child will be created.
Additional children are laid out in the following manner:
+ The first MenuBar child is placed at the top of the window. The
XmQTmenuSystem trait is used to check that it is the first
MenuBar child.
+ All widgets or gadgets are placed after the OK button in the
order of their creation (this order is checked using the
XmQTactivatable trait).
+ A child that is not in the above categories is placed above the
row of buttons. If a message label exists, the child is placed
below the label. If a message pixmap exists, but a message label
- 1 - Formatted: January 24, 2005
XmMessageBox(library call) XmMessageBox(library call)
is absent, the child is placed on the same row as the pixmap.
The child behaves as a work area and grows or shrinks to fill
the space above the row of buttons. The layout of multiple work
area children is undefined.
At initialization, MessageBox looks for the following bitmap files:
+ xm_error
+ xm_information
+ xm_question
+ xm_working
+ xm_warning
See XmGetPixmap(3) for a list of the paths that are searched for these
files.
MessageBox uses the XmQTactivatable and XmQTmenuSystem traits.
Descendants [Toc] [Back]
MessageBox automatically creates the descendants shown in the
following table. An application can use XtNameToWidget to gain access
to the named descendant. In addition, a user or an application can use
the named descendant when specifying resource values.
_______________________________________________________________________
|Named Descendant | Class | Identity |
|_________________|____________________|_______________________________|
|_________________|____________________|_______________________________|
|_________________|____________________|_______________________________|
|Cancel | XmPushButtonGadget | Cancel button |
|_________________|____________________|_______________________________|
|Help | XmPushButtonGadget | Help button |
|_________________|____________________|_______________________________|
|Message | XmLabelGadget | displayed message |
|_________________|____________________|_______________________________|
|OK | XmPushButtonGadget | OK button |
|_________________|____________________|_______________________________|
|Separator | XmSeparatorGadget | dividing line between message |
| | | and buttons |
|_________________|____________________|_______________________________|
|Symbol | XmLabelGadget | icon symbolizing message type |
|_________________|____________________|_______________________________|
|_________________|____________________|_______________________________|
Classes [Toc] [Back]
MessageBox inherits behavior, resources, and traits from Core,
Composite, Constraint, XmManager, and XmBulletinBoard.
- 2 - Formatted: January 24, 2005
XmMessageBox(library call) XmMessageBox(library call)
The class pointer is xmMessageBoxWidgetClass.
The class name is XmMessageBox.
New Resources [Toc] [Back]
The following table defines a set of widget resources used by the
programmer to specify data. The programmer can also set the resource
values for the inherited classes to set attributes for this widget. To
reference a resource by name or by class in a .Xdefaults file, remove
the XmN or XmC prefix and use the remaining letters. To specify one of
the defined values for a resource in a .Xdefaults file, remove the Xm
prefix and use the remaining letters (in either lowercase or
uppercase, but include any underscores between words). The codes in
the access column indicate if the given resource can be set at
creation time (C), set by using XtSetValues (S), retrieved by using
XtGetValues (G), or is not applicable (N/A).
_______________________________________________________________________________________________
| XmMessageBox Resource Set |
|Name Class Type Default Access |
|_____________________|______________________|________________|_______________________|________|
|XmNcancelCallback | XmCCallback | XtCallbackList | NULL | C |
|_____________________|______________________|________________|_______________________|________|
|XmNcancelLabelString | XmCCancelLabelString | XmString | dynamic | CSG |
|_____________________|______________________|________________|_______________________|________|
|XmNdefaultButtonType | XmCDefaultButtonType | unsigned char | XmDIALOG_OK_BUTTON | CSG |
|_____________________|______________________|________________|_______________________|________|
|XmNdialogType | XmCDialogType | unsigned char | XmDIALOG_MESSAGE | CSG |
|_____________________|______________________|________________|_______________________|________|
|XmNhelpLabelString | XmCHelpLabelString | XmString | dynamic | CSG |
|_____________________|______________________|________________|_______________________|________|
|XmNmessageAlignment | XmCAlignment | unsigned char | XmALIGNMENT_BEGINNING | CSG |
|_____________________|______________________|________________|_______________________|________|
|XmNmessageString | XmCMessageString | XmString | "" | CSG |
|_____________________|______________________|________________|_______________________|________|
|XmNminimizeButtons | XmCMinimizeButtons | Boolean | False | CSG |
|_____________________|______________________|________________|_______________________|________|
|XmNokCallback | XmCCallback | XtCallbackList | NULL | C |
|_____________________|______________________|________________|_______________________|________|
|XmNokLabelString | XmCOkLabelString | XmString | dynamic | CSG |
|_____________________|______________________|________________|_______________________|________|
|XmNsymbolPixmap | XmCPixmap | Pixmap | dynamic | CSG |
|_____________________|______________________|________________|_______________________|________|
|_____________________|______________________|________________|_______________________|________|
XmNcancelCallback [Toc] [Back]
Specifies the list of callbacks that is called when the user
clicks on the cancel button. The reason sent by the
callback is XmCR_CANCEL.
- 3 - Formatted: January 24, 2005
XmMessageBox(library call) XmMessageBox(library call)
XmNcancelLabelString [Toc] [Back]
Specifies the string label for the cancel button. The
default for this resource depends on the locale. In the C
locale the default is Cancel.
Now that some default localized label strings are provided
through message catalogs for the children of composite
widgets, the labelString resources cannot be set on the
child through default resource files. Instead, the resource
provided at the parent level must be used.
XmNdefaultButtonType [Toc] [Back]
Specifies the default PushButton. A value of XmDIALOG_NONE
means that there should be no default PushButton. The
following types are valid:
+ XmDIALOG_CANCEL_BUTTON
+ XmDIALOG_OK_BUTTON
+ XmDIALOG_HELP_BUTTON
+ XmDIALOG_NONE
XmNdialogType [Toc] [Back]
Specifies the type of MessageBox dialog, which determines
the default message symbol. The following are the possible
values for this resource:
XmDIALOG_ERROR [Toc] [Back]
Indicates an ErrorDialog.
XmDIALOG_INFORMATION [Toc] [Back]
Indicates an InformationDialog.
XmDIALOG_MESSAGE [Toc] [Back]
Indicates a MessageDialog. This is the default
MessageBox dialog type. It does not have an
associated message symbol.
XmDIALOG_QUESTION [Toc] [Back]
Indicates a QuestionDialog.
XmDIALOG_TEMPLATE [Toc] [Back]
Indicates a TemplateDialog. The TemplateDialog
contains only a separator child. It does not have
an associated message symbol.
XmDIALOG_WARNING [Toc] [Back]
Indicates a WarningDialog.
- 4 - Formatted: January 24, 2005
XmMessageBox(library call) XmMessageBox(library call)
XmDIALOG_WORKING [Toc] [Back]
Indicates a WorkingDialog.
If this resource is changed with XtSetValues, the symbol
bitmap is modified to the new XmNdialogType bitmap unless
XmNsymbolPixmap is also being set in the call to
XtSetValues. If the dialog type does not have an associated
message symbol, then no bitmap will be displayed.
XmNhelpLabelString [Toc] [Back]
Specifies the string label for the help button. The default
for this resource depends on the locale. In the C locale
the default is Help.
Now that some default localized label strings are provided
through message catalogs for the children of composite
widgets, the labelString resources cannot be set on the
child through default resource files. Instead, the resource
provided at the parent level must be used.
XmNmessageAlignment [Toc] [Back]
Controls the alignment of the message Label. Possible
values include the following:
+ XmALIGNMENT_BEGINNING (default)
+ XmALIGNMENT_CENTER
+ XmALIGNMENT_END
See the description of XmNalignment in the XmLabel reference
page for an explanation of these values.
XmNmessageString [Toc] [Back]
Specifies the string to be used as the message.
XmNminimizeButtons [Toc] [Back]
Sets the buttons to the width of the widest button and
height of the tallest button if False. If this resource is
True, button width and height are set to the preferred size
of each button.
XmNokCallback [Toc] [Back]
Specifies the list of callbacks that is called when the user
clicks on the OK button. The reason sent by the callback is
XmCR_OK.
XmNokLabelString [Toc] [Back]
Specifies the string label for the OK button. The default
for this resource depends on the locale. In the C locale
the default is OK.
- 5 - Formatted: January 24, 2005
XmMessageBox(library call) XmMessageBox(library call)
Now that some default localized label strings are provided
through message catalogs for the children of composite
widgets, the labelString resources cannot be set on the
child through default resource files. Instead, the resource
provided at the parent level must be used.
XmNsymbolPixmap [Toc] [Back]
Specifies the pixmap label to be used as the message symbol.
Inherited Resources [Toc] [Back]
MessageBox inherits behavior and resources from the superclasses
described in the following tables. For a complete description of each
resource, refer to the reference page for that superclass.
- 6 - Formatted: January 24, 2005
XmMessageBox(library call) XmMessageBox(library call)
_______________________________________________________________________________________
| XmBulletinBoard Resource Set |
|Name Class Type Default Access |
|_____________________|______________________|________________|_______________|________|
|XmNallowOverlap | XmCAllowOverlap | Boolean | True | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNautoUnmanage | XmCAutoUnmanage | Boolean | True | CG |
|_____________________|______________________|________________|_______________|________|
|XmNbuttonFontList | XmCButtonFontList | XmFontList | dynamic | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNbuttonRenderTable | XmCButtonRenderTable | XmRenderTable | dynamic | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNcancelButton | XmCWidget | Widget | Cancel button | SG |
|_____________________|______________________|________________|_______________|________|
|XmNdefaultButton | XmCWidget | Widget | dynamic | SG |
|_____________________|______________________|________________|_______________|________|
|XmNdefaultPosition | XmCDefaultPosition | Boolean | True | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNdialogStyle | XmCDialogStyle | unsigned char | dynamic | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNdialogTitle | XmCDialogTitle | XmString | NULL | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNfocusCallback | XmCCallback | XtCallbackList | NULL | C |
|_____________________|______________________|________________|_______________|________|
|XmNlabelFontList | XmCLabelFontList | XmFontList | dynamic | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNlabelRenderTable | XmCLabelRenderTable | XmRenderTable | dynamic | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNmapCallback | XmCCallback | XtCallbackList | NULL | C |
|_____________________|______________________|________________|_______________|________|
|XmNmarginHeight | XmCMarginHeight | Dimension | 10 | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNmarginWidth | XmCMarginWidth | Dimension | 10 | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNnoResize | XmCNoResize | Boolean | False | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNresizePolicy | XmCResizePolicy | unsigned char | XmRESIZE_ANY | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNshadowType | XmCShadowType | unsigned char | XmSHADOW_OUT | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNtextFontList | XmCTextFontList | XmFontList | dynamic | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNtextRenderTable | XmCTextRenderTable | XmRenderTable | dynamic | CSG |
|_____________________|______________________|________________|_______________|________|
|XmNtextTranslations | XmCTranslations | XtTranslations | NULL | C |
|_____________________|______________________|________________|_______________|________|
|XmNunmapCallback | XmCCallback | XtCallbackList | NULL | C |
|_____________________|______________________|________________|_______________|________|
|_____________________|______________________|________________|_______________|________|
- 7 - Formatted: January 24, 2005
XmMessageBox(library call) XmMessageBox(library call)
_____________________________________________________________________________________________________
| XmManager Resource Set |
|Name Class Type Default Access |
|________________________|_______________________|___________________|______________________|________|
|XmNbottomShadowColor | XmCBottomShadowColor | Pixel | dynamic | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNbottomShadowPixmap | XmCBottomShadowPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNforeground | XmCForeground | Pixel | dynamic | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNhelpCallback | XmCCallback | XtCallbackList | NULL | C |
|________________________|_______________________|___________________|______________________|________|
|XmNhighlightColor | XmCHighlightColor | Pixel | dynamic | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNhighlightPixmap | XmCHighlightPixmap | Pixmap | dynamic | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNinitialFocus | XmCInitialFocus | Widget | dynamic | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNlayoutDirection | XmCLayoutDirection | XmDirection | dynamic | CG |
|________________________|_______________________|___________________|______________________|________|
|XmNnavigationType | XmCNavigationType | XmNavigationType | XmTAB_GROUP | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNpopupHandlerCallback | XmCCallback | XtCallbackList | NULL | C |
|________________________|_______________________|___________________|______________________|________|
|XmNshadowThickness | XmCShadowThickness | Dimension | dynamic | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNstringDirection | XmCStringDirection | XmStringDirection | dynamic | CG |
|________________________|_______________________|___________________|______________________|________|
|XmNtopShadowColor | XmCTopShadowColor | Pixel | dynamic | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNtopShadowPixmap | XmCTopShadowPixmap | Pixmap | dynamic | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNtraversalOn | XmCTraversalOn | Boolean | True | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNunitType | XmCUnitType | unsigned char | dynamic | CSG |
|________________________|_______________________|___________________|______________________|________|
|XmNuserData | XmCUserData | XtPointer | NULL | CSG |
|________________________|_______________________|___________________|______________________|________|
|________________________|_______________________|___________________|______________________|________|
________________________________________________________________________
Composite Resource Set
Name Class Type Default Access
________________________________________________________________________
XmNchildren XmCReadOnly WidgetList NULL G
________________________________________________________________________
XmNinsertPosition XmCInsertPosition XtOrderProc NULL CSG
________________________________________________________________________
XmNnumChildren XmCReadOnly Cardinal 0 G
________________________________________________________________________
________________________________________________________________________
- 8 - Formatted: January 24, 2005
XmMessageBox(library call) XmMessageBox(library call)
| | | | | |
________________________________________________________________________________________________________________
| | | Core Resource Set | |
|Name | Class | | | Type | Default Access |
|______________________________|_______________________________|________________|______________________|________|
|XmNaccelerators | | XmCAccelerators | | XtAccelerators | dynamic | N/A |
|______________________________|_______________________________|________________|______________________|________|
|XmNancestorSensitive | XmCSensitive | | Boolean| | dynamic | G |
|______________________________|_______________________________|________________|______________________|________|
|XmNbackground | | XmCBackground | | Pixel | | dynamic | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNbackgroundPixmap | XmCPixmap | | Pixmap | | XmUNSPECIFIED_PIXMAP | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNborderColor | | XmCBorderColor | | Pixel | | XtDefaultForeground | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNborderPixmap | | XmCPixmap | | Pixmap | | XmUNSPECIFIED_PIXMAP | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNborderWidth | | XmCBorderWidth | | Dimension | 0 | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNcolormap | | XmCColormap | | Colormap | dynamic | CG |
|______________________________|_______________________________|________________|______________________|________|
|XmNdepth | | XmCDepth | | int | | dynamic | CG |
|______________________________|_______________________________|________________|______________________|________|
|XmNdestroyCallback| | XmCCallback | | XtCallbackList | NULL | C |
|______________________________|_______________________________|________________|______________________|________|
|XmNheight | | XmCHeight | | Dimension | dynamic | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNinitialResourcesPersistent | XmCInitialResourcesPersistent | Boolean| | True | C |
|______________________________|_______________________________|________________|______________________|________|
|XmNmappedWhenManaged | XmCMappedWhenManaged| | Boolean| | True | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNscreen | | XmCScreen | | Screen * | dynamic | CG |
|______________________________|_______________________________|________________|______________________|________|
|XmNsensitive | | XmCSensitive | | Boolean| | True | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNtranslations | | XmCTranslations | | XtTranslations | dynamic | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNwidth | | XmCWidth | | Dimension | dynamic | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNx | | XmCPosition | | Position | 0 | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNy | | XmCPosition | | Position | 0 | CSG |
|______________________________|_______________________________|________________|______________________|________|
|______________________________|_______________________________|________________|______________________|________|
Callback Information [Toc] [Back]
A pointer to the following structure is passed to each callback:
typedef struct
{
- 9 - Formatted: January 24, 2005
XmMessageBox(library call) XmMessageBox(library call)
int reason;
XEvent *event;
} XmAnyCallbackStruct;
reason Indicates why the callback was invoked
event Points to the XEvent that triggered the callback
Translations [Toc] [Back]
XmMessageBox includes the translations from XmManager.
Additional Behavior [Toc] [Back]
The XmMessageBox widget has the following additional behavior:
<Key><osfCancel>:
Calls the activate callbacks for the cancel button if it is
sensitive.
<Key><osfActivate>:
Calls the activate callbacks for the button with the
keyboard focus. If no button has the keyboard focus, calls
the activate callbacks for the default button if it is
sensitive.
<Ok Button Activated>:
Calls the callbacks for XmNokCallback.
<Cancel Button Activated>:
Calls the callbacks for XmNcancelCallback.
<Help Button Activated>:
Calls the callbacks for XmNhelpCallback.
<FocusIn>:
Calls the callbacks for XmNfocusCallback.
<Map>: Calls the callbacks for XmNmapCallback if the parent is a
DialogShell.
<Unmap>: Calls the callbacks for XmNunmapCallback if the parent is a
DialogShell.
Virtual Bindings [Toc] [Back]
The bindings for virtual keys are vendor specific. For information
about bindings for virtual buttons and keys, see VirtualBindings(3).
RELATED [Toc] [Back]
Composite(3), Constraint(3), Core(3), XmBulletinBoard(3),
XmCreateErrorDialog(3), XmCreateInformationDialog(3),
XmCreateMessageBox(3), XmCreateMessageDialog(3),
XmCreateQuestionDialog(3), XmCreateTemplateDialog(3),
- 10 - Formatted: January 24, 2005
XmMessageBox(library call) XmMessageBox(library call)
XmCreateWarningDialog(3), XmCreateWorkingDialog(3), XmManager(3), and
XmMessageBoxGetChild(3).
- 11 - Formatted: January 24, 2005 [ Back ] |