Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

MenuShell(3W)

PopupWindowShell(3W)

NoticeShell(3W)

DrawArea(3W)

multiplevisual(3W)

NAME

OlColormapOfObject, OlDepthOfObject, OlInternAtom, OlVisualOfObject

SYNOPSIS and DESCRIPTION

A visual is specified by a depth (for example 8 bits) and a visual class (for example PseudoColor). 

A shell widget or a DrawArea widget can have a nondefault visual.  Other widgets use the visuals of their nearest shell or DrawArea ancestor .  An application in which eligible widgets have non-default visuals is termed a multi-visual application. 

NOTE:

To avoid difficulty with the current implementation, it is necessary to specify the visual class when you specify the depth, or the depth will be ignored.  Specifically, you should use the XtVaTypedArg interface with XtVaCreateManagedWidget, rather than XMatchVisualinfo.  (The argument list interface implicitly invokes the resource converter, while XMatchVisualinfo does not.  Trying to set the depth without also setting the visual class and running the resource converter can create problems.) 

For example, in creating a DrawArea widget using this interface, you might use something like:

drawarea = XtVaCreateManagedWidget("drawarea",
drawAreaWidgetClass, toplevel,
XtVaTypedArg,
XtNvisual,
XtRString,
VisualClassName,
sizeof(VisualClassName),
XtNlayout, OL_IGNORE,
XtNheight, Height,
XtNwidth, Width,
NULL);

Each multiple visual function returns a characteristic of either a widget or gadget. 

Multiple visuals are only really meant to run on machines with hardware colormaps, otherwise serious flashing results when the mouse pointer moves between applications or widgets with different visuals. 

OlColormapOfObject

#include <Xol/OpenLook.h>
 . . .
extern Colormap OlColormapOfObject(

Widget w);

OlColormapOfObject obtains the colormap associated with the object.

OlDepthOfObject

#include <Xol/OpenLook.h>
 . . .
extern int OlDepthOfObject(

Widget w);

OlDepthOfObject obtains the depth associated with the object.

OlInternAtom

#include <Xol/OpenLook.h>
 . . .
Atom OlInternAtom(

Display ∗dpy,
String atom_name);

This function uses the Intrinsics XtRString to XtRAtom resource converter and the converter cache to store Atoms in the resource cache on a per display basis. 

All aplications should use this function to cache Atoms across displays, especially applications using multiple display.  connections should use this function to cache Atoms across displays. 

Note that for efficient use of the resource converter cache, the string ’name’ should be the same physical string for each invocation:

OlInternAtom(dpy, "foo");
OlInternAtom(dpy, "foo");

results in TWO entries in the resource converter cache, while

char ∗foo = "foo";
OlInternAtom(dpy, foo);
OlInternAtom(dpy, foo);

results in only one cache entry. 

OlVisualOfObject

#include <Xol/OpenLook.h>
 . . .
extern Visual ∗OlVisualOfObject(

Widget object);

OlVisualOfObject obtains the visual associated with the object.

SEE ALSO

MenuShell(3W), PopupWindowShell(3W), NoticeShell(3W), DrawArea(3W)

Version 3.0.1  —  Last change: June 92

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