Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ControlArea(3w)

resources(3w)

StaticText(3w)

NoticeShell(3w)  —  OLIT Widget Set

NAME

NoticeShell − notice shell widget

SYNOPSIS

#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <Xol/OpenLook.h>
#include <Xol/Notice.h>
 . . .
Widget my_notice, my_parent;
String my_name;
ArgList args;
Cardinal num_args;

my_notice = XtCreatePopupShell( my_name, noticeShellWidgetClass,

my_parent, args, num_args);

 . . . 
Widget textarea, controlarea;

XtSetArg( args[0], XtNtextArea, (XtArgVal) &textarea);

XtSetArg( args[1], XtNcontrolArea, (XtArgVal) &controlarea);

XtGetValues( my_notice, args, 2);
Widget a_control_item;
WidgetClass item_class;
String item_name;

a_control_item =  XtCreate( item_name, item_class, controlarea, args, num_args);

XtPopup( a_notice_item, XtGrabExclusive);

DESCRIPTION

Components

The Notice widget has three components: (see the diagram

where the message to the end user is displayed;

containing one or more widgets that the end user uses to control how to continue with an application;

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. 

  Figure 1 Notice Widget

Subwidgets

The NoticeShell contains two subwidgets, a StaticText, and a ControlArea, provided automatically, and accessible through the XtNtextArea, XtNcontrolArea resources respectively. 

  Figure 2 NoticeShell Subwidgets  NoticeShell
     |
     _____________________________
     |                           |
   StaticText              ControlArea (XtNtextArea)           (XtNcontrolArea)

Subclass of the Shell Widget

The Notice widget is a sub-class of Shell so, the XtCreatePopupShell() routine is used to create a notice instead of the normal XtCreateWidget(). 

Popping the Notice

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 ControlAreas

The Text and ControlArea are handled by separate widget interfaces.  The SYNOPSIS shows how the widget IDs of the Text (textarea) and the ControlArea "controlarea" ) ( are obtained from the Notice widget. 

The Text and ControlArea abut with no space between them.  An application can control the distance between the Textand the controls by setting margins in the ControlArea. 

Coloration

of the Notice widget. 

  Figure 3 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
OL_SELECTKEY
 

RESOURCES

SUBSTRUCTURE

Control Area component

Name: controlarea
Class: ControlArea

  Table 1 Control Area application Resources

Notice        Widget    Control      Area
Name          Class     Type         Default
 
XtNhPad       XtCHPad   Dimension    0
XtNhSpace     Dimension 4            I
XtNlayoutType OllDefine OL_FIXEDROWS I
XtNmeasure    int       1            I
XtNsameSize   OlDefine  OL_COLUMNS   I
XtNvPad       Dimension 0            I
XtNvSpace     Dimension 4            I

Access:S = XtSetValues G = XtGetValues
        I = init timeO = other access
† see resources(3W)

See ControlArea(3W) for the descriptions of these resources. 

Text Area component

Name: textarea
Class: StaticText

  Table 2 Text Area Resources

Notice       Widget       Text    Area
Name         Type         Default Access
 
XtNalignment int          OL_LEFT I
XtNfont      XFontStruct∗ (OPEN   LOOK
XtNfontColor Pixel        Black   SGI
XtNlineSpace int          0       I
XtNstring    String       NULL    I
XtNstrip     Boolean      TRUE    I
XtNwrap      Boolean      TRUE    I

Access:S = XtSetValues G = XtGetValues
        I = init timeO = other access

See StaticText(3W) widget for the descriptions of these resources. 

  Table 3 Notice Widget Resource Summary

Notice                  Resource               Set
Name                    Type                   Default             Access
 
XtNallowShellResize     Boolean                TRUE                SGI
XtNancestorSensitive    Boolean                TRUE                GO
XtNbackground           Pixel                  XtDefaultBackground SGI
XtNbackgroundPixmap     Pixmap                 (none)              SGI
XtNborderColor          Pixel                  XtDefaultBackground SGI
XtNborderPixmap         Pixmap                 (none)              SGI
XtNconsumeEvent         XtCallbackList         NULL                SGI
XtNcontrolArea          Widget                 (none)              G
XtNcreatePopupChildProc XtCreatePopupChildProc NULL                SGI
XtNdepth                int                    (parent’s)          GI
XtNdestroyCallback      XtCallbackList         NULL                SI
XtNemanateWidget        Widget                 (parent’s)          SGI
XtNfocusWidget          Widget                 NULL                SGI
XtNgeometry             String                 NULL                GI
XtNheight               Dimension              (calculated)        SGI
XtNpopdownCallback      XtCallbackList         NULL                SI
XtNpopupCallback        XtCallbackList         NULL                SI
XtNsaveUnder            Boolean                FALSE               SGI
XtNsensitive            Boolean                TRUE                GIO
XtNtextArea             Widget                 (none)              G
XtNuserData             XtPointer              NULL                SGI
XtNwidth                Dimension              (calculated)        SGI
XtNx                    Position               0                   SGI
XtNy                    Position               0                   SGI

Access:S = XtSetValues G = XtGetValues
        I = init timeO = other access
† see resources(3W)

XtNcontrolArea

 class:XtCControlAreatype:Widgetdefault:(none)(none)’u’access:GG’u’

Action: gives the widget ID of the ControlArea widget. 

Values: ID of existing widget

This value is available once the Notice widget has been created.  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

 class:XtCEmanateWidgettype:Widgetdefault:(parent’s)(parent’s)’u’access:SGISGI’u’

Action: identifies the emanate widget. 

Values: ID of existing 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. 

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. 
 

XtNtextArea

 class:XtCTextAreatype:Widgetdefault:(none)(none)’u’access:GG’u’

Action gives the widget ID of the StaticText widget that controls the text area

Values: ID of existing widget

This value is available once the Notice widget has been created. 
 
 

SEE ALSO

ControlArea(3w), resources(3w), StaticText(3w)

Version 3.0  —  Last change: 19 July 91

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026