NoticeShell(3W) UNIX System V NoticeShell(3W)
NAME
NoticeShell - contains a message area which is used for user
confirmation
SYNOPSIS
#include <Intrinsic.h>
#include <StringDefs.h>
#include <OpenLook.h>
#include <Notice.h>
static Widget notice, textarea, controlarea, w;
Arg args[2];
notice = XtCreatePopupShell(name, noticeShellWidgetClass, ...);
XtSetArg(args[0], XtNtextArea, &textarea);
XtSetArg(args[1], XtNcontrolArea, &controlarea);
XtGetValues(notice, args, 2);
w = XtCreateWidget(name, widget-class, controlarea, ...);
.
.
.
XtPopup(notice, XtGrabExclusive);
DESCRIPTION
___________________________________________________
| Default Window Decorations |
|__________________|________________|______________|
| Resource | Type | Default|
|__________________|________________|______________|
|__________________|________________|______________|
| XtNmenuButton | Boolean | FALSE |
|__________________|________________|______________|
| XtNpushpin | OlDefine | OL_NONE|
|__________________|________________|______________|
| XtNresizeCorners | Boolean | FALSE |
|__________________|________________|______________|
| XtNwindowHeader | Boolean | FALSE |
|__________________|________________|______________|
Notice Components
The Notice widget has three components: a Text Area where the message to
the end user is displayed; a Control Area containing one or more widgets
that the end user uses to control how to continue with an application;
and a Default Button. Another important element is the Emanate Widget,
which is typically the control activated by the end user that requires
immediate attention. The application identifies the Emanate Widget to
the Notice widget.
10/89 Page 1
NoticeShell(3W) UNIX System V NoticeShell(3W)
Figure 1. Notice Widget
Sub-class of the Shell Widget
The Notice widget is a sub-class of the Shell widget. Therefore, as the
SYNOPSIS shows, the XtCreatePopupShell() routine is used to create a
notice instead of the normal XtCreateWidget().
Popping the Notice Up/Down
The application controls when the Notice widget is to be displayed or
popped up. As shown in the SYNOPSIS, the XtPopup() routine can be used
for this.
However, the application does not need to control when the Notice widget
is to be popped down. The widget itself detects when to pop down: the
end user clicks SELECT on an OblongButton widget in the Control Area.
This behavior requires that there be at least one OblongButton widget in
the Control Area. If other types of controls are used instead, the
application can "manually" pop the notice down using a routine such as
XtPopdown().
Busy Button, Busy Application
When the Notice pops up, it "freezes" the entire application except the
Notice to prevent the end user from interacting with any other part of
the application. As feedback of this to the user, the Notice causes the
headers of all the base windows and pop-up windows to be stippled in the
"busy" pattern, and causes a
stipple pattern in the Emanate Widget. The latter stipple pattern is
caused by
setting the XtNbusy resource to TRUE in the Emanate Widget. If the
widget does not recognize this resource, nothing will happen.
On popping down, the Notice widget clears all stipple patterns and
"unfreezes" the application.
Text and Control Areas
The Text and Control Areas are handled by separate widget interfaces.
The SYNOPSIS shows how the widget IDs of the Text Area (textarea) and the
Control Area (controlarea) are obtained from the Notice widget.
The Text and Control Areas abut so that there is no space between the
two. An application can control the distance between the text and the
controls by setting margins in the Control Area.
Notice Coloration
Figure 2 illustrates the resources that affect the coloration of the
Notice widget.
Page 2 10/89
NoticeShell(3W) UNIX System V NoticeShell(3W)
Figure 2. Notice Coloration
Keyboard Traversal
The Notice widget limits keyboard traversal of the application to the
buttons within the ControlArea. The user can traverse between the
controls in the ControlArea using the NEXT_FIELD, PREV_FIELD, MOVEUP,
MOVEDOWN, MOVERIGHT, and MOVELEFT keys. The NEXTAPP key will traverse to
the next application, and the PREVAPP key will traverse to the the
previous application, but the NEXTWINDOW and PREVWINDOW keys are
disabled. When keyboard traversal is used to move back to the Notice's
application, focus goes to the Notice.
_________________________________________________________________________
| Notice Activation Types |
|____________________________|___________________________________________|
| Activation Type | Expected Results |
|____________________________|___________________________________________|
| OL_CANCEL | Beep |
| OL_DEFAULTACTION | Call OlActivateWidget for the |
| | default widget with parameter |
| | OL_SELECTKEY |
|____________________________|___________________________________________|
SUBSTRUCTURE
Control Area component
Name: controlarea
Class: ControlArea
__________________________________________________________________________
| Application Resources |
|_______________|________________|____________|_______________|___________|
| Name | Class | Type | Default | Access |
|_______________|________________|____________|_______________|___________|
|_______________|________________|____________|_______________|___________|
| XtNhPad | XtCHPad | Dimension | 0 | I |
|_______________|________________|____________|_______________|___________|
| XtNhSpace | XtCHSpace | Dimension | 4 | I |
|_______________|________________|____________|_______________|___________|
| XtNlayoutType | XtCLayoutType | OllDefine | OL_FIXEDROWS | I |
|_______________|________________|____________|_______________|___________|
| XtNmeasure | XtCMeasure | int | 1 | I |
|_______________|________________|____________|_______________|___________|
| XtNsameSize | XtCSameSize | OlDefine | OL_COLUMNS | I |
|_______________|________________|____________|_______________|___________|
| XtNvPad | XtCVPad | Dimension | 0 | I |
|_______________|________________|____________|_______________|___________|
| XtNvSpace | XtCVSpace | Dimension | 4 | I |
|_______________|________________|____________|_______________|___________|
See the ControlArea widget for the descriptions of these resources.
Text Area component
Name: textarea
10/89 Page 3
NoticeShell(3W) UNIX System V NoticeShell(3W)
Class: StaticText
________________________________________________________________________________
| Application Resources |
|______________|_______________|________________|___________________|___________|
| Name | Class | Type | Default | Access |
|______________|_______________|________________|___________________|___________|
|______________|_______________|________________|___________________|___________|
| XtNalignment | XtCAlignment | int | OL_LEFT | I |
|______________|_______________|________________|___________________|___________|
| XtNfont | XtCFont | XFontStruct * | (OPEN LOOK font) | SI |
|______________|_______________|________________|___________________|___________|
| XtNfontColor | XtCFontColor | Pixel | Black* | SGI |
|______________|_______________|________________|___________________|___________|
| XtNlineSpace | XtCLineSpace | int | 0 | I |
|______________|_______________|________________|___________________|___________|
| XtNstring | XtCString | String | NULL | I |
|______________|_______________|________________|___________________|___________|
| XtNstrip | XtCStrip | Boolean | TRUE | I |
|______________|_______________|________________|___________________|___________|
| XtNwrap | XtCWrap | Boolean | TRUE | I |
|______________|_______________|________________|___________________|___________|
See the StaticText widget for the descriptions of these resources.
RESOURCES
_________________________________________________________________________________________________
Notice Resource Set
_________________________________________________________________________________________________
Name Class Type Default Access
_________________________________________________________________________________________________
_________________________________________________________________________________________________
XtNallowShellResize XtCAllowShellResize Boolean TRUE SGI
_________________________________________________________________________________________________
Page 4 10/89
NoticeShell(3W) UNIX System V NoticeShell(3W)
| XtNancestorSensitive | XtCSenstitive | Boolean | TRUE | G* |
|________________________|________________________|_______________________|_____________|________|
| XtNbackground | XtCBackground | Pixel | White | SGI† |
|________________________|________________________|_______________________|_____________|________|
| XtNbackgroundPixmap | XtCPixmap | Pixmap | (none) | SGI† |
|________________________|________________________|_______________________|_____________|________|
| XtNborderColor | XtCBorderColor | Pixel | White | SGI† |
|________________________|________________________|_______________________|_____________|________|
| XtNborderPixmap | XtCPixmap | Pixmap | (none) | SGI† |
|________________________|________________________|_______________________|_____________|________|
| XtNconsumeEvent | XtCConsumeEvent | XtCallbackList | NULL | SGI |
|________________________|________________________|_______________________|_____________|________|
| XtNcontrolArea | XtCControlArea | Widget | (none) | G |
|________________________|________________________|_______________________|_____________|________|
| XtNcreatePopupChildProc| XtCCreatePopupChildProc| XtCreatePopupChildProc| NULL | SGI |
|________________________|________________________|_______________________|_____________|________|
| XtNdepth | XtCDepth | int | (parent's) | GI |
|________________________|________________________|_______________________|_____________|________|
| XtNdestroyCallback | XtCCallback | XtCallbackList | NULL | SI |
|________________________|________________________|_______________________|_____________|________|
| XtNemanateWidget | XtCEmanateWidget | Widget | (parent's) | SGI |
|________________________|________________________|_______________________|_____________|________|
| XtNfocusWidget | XtCFocusWidget | Widget | NULL | SGI |
|________________________|________________________|_______________________|_____________|________|
| XtNgeometry | XtCGeometry | String | NULL | GI |
|________________________|________________________|_______________________|_____________|________|
| XtNheight | XtCHeight | Dimension | (calculated)| SGI |
|________________________|________________________|_______________________|_____________|________|
| XtNpopdownCallback | XtCCallback | XtCallbackList | NULL | SI |
|________________________|________________________|_______________________|_____________|________|
| XtNpopupCallback | XtCCallback | XtCallbackList | NULL | SI |
|________________________|________________________|_______________________|_____________|________|
| XtNsaveUnder | XtCSaveUnder | Boolean | FALSE | SGI |
|________________________|________________________|_______________________|_____________|________|
| XtNsensitive | XtCSensitive | Boolean | TRUE | GI* |
|________________________|________________________|_______________________|_____________|________|
| XtNtextArea | XtCTextArea | Widget | (none) | G |
|________________________|________________________|_______________________|_____________|________|
| XtNuserData | XtCUserData | XtPointer | NULL | SGI |
|________________________|________________________|_______________________|_____________|________|
| XtNwidth | XtCWidth | Dimension | (calculated)| SGI |
|________________________|________________________|_______________________|_____________|________|
| XtNx | XtCPosition | Position | 0 | SGI |
|________________________|________________________|_______________________|_____________|________|
| XtNy | XtCPosition | Position | 0 | SGI |
|________________________|________________________|_______________________|_____________|________|
XtNcontrolArea
This is the widget ID of the ControlArea class composite child widget
where controls can be attached; its value is available once the Notice
widget has been created.
10/89 Page 5
NoticeShell(3W) UNIX System V NoticeShell(3W)
Any widgets of the class OblongButton added to the Control Area are
assumed to be window disposition controls; that is, when the end user
activates one of them, the Notice widget pops itself down.
XtNemanateWidget
Range of Values:
(ID of existing widget)
This resource identifies the Emanate Widget. On popping up, the Notice
widget attempts to set this widget to be busy, by making its XtNbusy
resource TRUE; if the widget doesn't recognize the resource, nothing
happens. On popping down, the Notice widget clears the XtNbusy resource.
When the Notice widget pops up, it tries not to cover this widget; this
may fail depending on its location and the size of the Notice widget.
The default for this resource is the parent. The parent, however, cannot
be a Gadget (OblongButtonGadget, for instance). To emanate a Notice from
a Gadget, specify another widget as the parent and set XtNemanateWidget
to the Gadget.
XtNtextArea
This is the widget ID of the StaticText class child widget that controls
the Text Area; its value is available once the Notice widget has been
created.
XtNfocusWidget
This is the ID of the widget to get focus the next time this shell takes
focus. Therefore, as a user traverses objects via the keyboard or
explicitly sets focus to an object (e.g.clicking SELECT), the value of
the XtNfocusWidget resource is updated to reflect this as the object with
focus.
Page 6 10/89