Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtCreateWin(3) — OSF1 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

realize(4)

 

Name

XtCreateWindow — create widget’s working window. 

Synopsis

void XtCreateWindow(w, window_class, visual, value_mask, attributes)

    Widget w;
    unsigned int window_class;
    Visual ∗visual;
    XtValueMask value_mask;
    XSetWindowAttributes ∗attributes;

Arguments

wSpecifies the widget that is used to set the x,y coordinates and so on. 

window_class
Specifies the Xlib window class (InputOutput, InputOnly, or CopyFromParent). 

visualSpecifies the Xlib visual type (usually CopyFromParent). 

value_maskSpecifies which attribute fields to use. 

attributesSpecifies the window attributes to use in the XCreateWindow call. 

Description

A widget is responsible for creating its own window when its Core realize method is called.  Rather than call the Xlib XCreateWindow function explicitly, a realize method should call the Intrinsics analog XtCreateWindow, which simplifies the creation of windows for widgets.  XtCreateWindow calls the Xlib XCreateWindow function, merging values from the Core widget instance structure (see below) and attributes.  Then it assigns the created window to the widget’s core window field. 

XtCreateWindow evaluates the following fields of the Core widget structure:

•depth

•screen

•parent->core.window

•x and y

•width and height

•border_width

The x, y, width, height, and border_width window attributes are available to geometry managers.  These fields are maintained synchronously inside the Intrinsics.  When an XConfigureWindow is issued on the widget’s window (on request of its parent), these values are updated immediately rather than sometime later when the server generates a ConfigureNotify event.  (In fact, most widgets do not have SubstructureNotify turned on.)  This ensures that all geometry calculations are based on the internally consistent toolkit world, rather than on either an inconsistent world updated by asynchronous ConfigureNotify events or a consistent but slow world in which geometry managers ask the server for window sizes whenever they need to lay out their managed children. 

Window attributes are documented more fully in Volume One, Xlib Programming Manual, and Volume Two, Xlib Reference Manual; see XSetWindowAttributes for a summary. 

Structures

typedef struct {
Pixmap background_pixmap; /∗ background or None or ParentRelative ∗ /
unsigned long background_pixel; /∗ background pixel ∗/
Pixmap border_pixmap; /∗ border of the window ∗/
unsigned long border_pixel; /∗ border pixel value ∗/
int bit_gravity; /∗ one of bit gravity values ∗/
int win_gravity; /∗ one of the window gravity values ∗/
int backing_store; /∗ NotUseful, WhenMapped, Always ∗/
unsigned long backing_planes; /∗ planes to be preserved if possible ∗/
unsigned long backing_pixel; /∗ value to use in restoring planes ∗/
Bool save_under; /∗ should bits under be saved (popups) ∗/
long event_mask; /∗ set of events that should be saved ∗/
long do_not_propagate_mask; /∗ set of events that should not propagate ∗/
Bool override_redirect; /∗ boolean value for override-redirect ∗/
Colormap colormap; /∗ colormap to be associated with window ∗/
Cursor cursor; /∗ cursor to be displayed (or None) ∗/
} XSetWindowAttributes;
 /∗ Definitions for valuemask argument.  These control which fields in
 ∗ XSetWindowAttributes structure should be used.
 ∗/
 #define CWBackPixmap            (1L<<0)
#define CWBackPixel             (1L<<1)
#define CWBorderPixmap          (1L<<2)
#define CWBorderPixel           (1L<<3)
#define CWBitGravity            (1L<<4)
#define CWWinGravity            (1L<<5)
#define CWBackingStore          (1L<<6)
#define CWBackingPlanes         (1L<<7)
#define CWBackingPixel          (1L<<8)
#define CWOverrideRedirect      (1L<<9)
#define CWSaveUnder             (1L<<10)
#define CWEventMask             (1L<<11)
#define CWDontPropagate         (1L<<12)
#define CWColormap              (1L<<13)
#define CWCursor                (1L<<14)

See Also

realize(4)

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