Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

DwtWindow(3Dwt)

Name

DwtWindow, DwtWindowCreate − Creates a window widget for simple applications to display in the main window widget work area. 

Syntax

Widget DwtWindow(parent_widget, name, x, y, width,
                    height, callback)
     Widget parent_widget;
     char *name;
     Position x, y;
     Dimension width, height;
     DwtCallbackPtr callback;

Widget DwtWindowCreate (parent_widget, name,
                        override_arglist, override_argcount)
     Widget parent_widget;
     char *name;
     ArgList override_arglist;
     int override_argcount;

Arguments

parent_widget
Specifies the parent widget ID.

nameSpecifies the name of the created widget. 

xSpecifies the placement, in pixels, of the left side of the widget window relative to the inner upper left corner of the parent window.  This argument sets the DwtNx core widget attribute. 

ySpecifies, in pixels, the placement of the top of the widget window relative to the inner upper left corner of the parent window.  This argument sets the DwtNy core widget attribute. 

widthSpecifies in pixels the width of the widget window.  This argument sets the DwtNwidth core widget attribute. 

heightSpecifies in pixels the height of the widget window.  This argument sets the DwtNheight core widget attribute. 

callbackSpecifies the callback function or functions called when an Expose event occurs.  This argument sets the DwtNexposeCallback attribute associated with DwtWindowCreate. 

override_arglist
Specifies the application override argument list.

override_argcount
Specifies the number of attributes in the application override argument list (override_arglist). 

Description

The DwtWindow and DwtWindowCreate functions create an instance of the window widget and return its associated widget ID.  The window widget simplifies programming allowing you to create an application display directly in the main window widget work area.  the window widget simplifies programming by allowing you to create an application display directly in the main window widget work area.  When calling DwtWindow, you set the window widget attributes presented in the formal parameter list.  For DwtWindowCreate, you specify a list of attribute name/value pairs that represent all the possible window widget attributes. 

Inherited Attributes

Attribute Name Data Type Default
Core Attributes

DwtNx Position Determined by the geometry manager
DwtNy Position Determined by the geometry manager
DwtNwidth Dimension Widget-specific
DwtNheight Dimension Widget-specific
DwtNborderWidth Dimension One pixel
DwtNborder Pixel Default foreground color
DwtNborderPixmap Pixmap NULL
DwtNbackground Pixel Default background color
DwtNbackgroundPixmap Pixmap NULL
DwtNcolormap Colormap Default color map
DwtNsensitive Boolean True
Setting the sensitivity of the window causes all widgets contained in that window to be set to the same sensitivity as the window. 
DwtNancestorSensitive Boolean The bitwise AND of the parent widget’s DwtNsensitive and DwtNancestorSensitive attributes
DwtNaccelerators XtTranslations NULL
DwtNdepth int Depth of the parent window
DwtNtranslations XtTranslations NULL
DwtNmappedWhenManaged Boolean True
DwtNscreen Screen * The parent screen
DwtNdestroyCallback DwtCallbackPtr NULL
Common Attributes

DwtNforeground Pixel Default foreground color
DwtNhighlight Pixel Default foreground color
DwtNhighlightPixmap Pixmap NULL
DwtNuserData Opaque * NULL
DwtNdirectionRToL unsigned char DwtDirectionRightDown
DwtNfont NOT SUPPORTED
DwtNhelpCallback NOT SUPPORTED

Widget-Specific Attributes

Attribute Name Data Type Default
DwtNexposeCallback DwtCallbackPtr NULL

DwtNexposeCallback
Specifies the callback function or functions called when the window had an Expose event.  For this callback, the reason is DwtCRExpose. 

Return Value

These functions return the ID of the created widget. 

Callback Information

The following structure is returned to your callback:

typedef struct {
int reason;
XExposeEvent *event;
Window w;
} DwtWindowCallbackStruct;

The reason member is set to a constant that represents the reason why this callback was invoked.  For this callback, the reason member can be set to:

DwtCRExpose The window widget had an Expose event. 

The event member is a pointer to the Xlib structure XExposeEvent.  This structure is associated with exposure event processing, and, specifically, with Expose events.  For information on exposure event processing, see the Guide to the Xlib Library: C Language Binding. 

The members of the XExposeEvent structure associated with Expose events are window, x, y, width, height, and count.  The window member is set to the window ID of the exposed (damaged) window.  The x and y members are set to the coordinates relative to the drawable’s origin and indicate the upper-left corner of the rectangle.  The width and height members are set to the size (extent) of the rectangle.  The count member is set to the number of Expose events that are to follow.  If count is set to zero (0), no more Expose events follow for this window.  However, if count is set to nonzero, at least count Expose events and possibly more follow for this window.  Simple applications that do not want to optimize redisplay by distinguishing between subareas of its windows can just ignore all Expose events with nonzero counts and perform full redisplays on events with zero counts. 

The w member is set to the X window ID where the Expose event occurred. 

See Also

Guide to the XUI Toolkit: C Language Binding
Guide to the XUI Toolkit Intrinsics: C Language Binding

Subroutines

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