<<<<<<<<<<<<<<<<

xshared_cell(x) Xlib xshared_cell(x)

NAME

xshared_cell - a shared colormap cell

DESCRIPTION

The xshared_cell class provides an interface shared X colormap cells.

SUPERCLASS

object

INSTANCE VARIABLES

colormap is the name of the associated xcolormap object. If no colormap is specified, the default colormap for the display will be used.

display is the name of the associated xdisplay object.

freeable indicates whether or not the last pixel allocated using this object is freeable (1 for true, 0 for false.) This is important information used by the free! method.

pixel is the pixel for the shared cell.

screen is the name of an xscreen instance. If no screen is specified, the default screen of the X display is used. The screen is used during allocation, so make sure to set this instance variable before you allocate the cell.

MESSAGES

colormap= colormap_object_name sets the colormap instance variable.

colormap? returns the value of the colormap instance variable on the argument stack.

color: colorname allocates a shared cell for the color specified. If the exact color cannot be allocated, the workstations closest color will be allocated. For a full list of possible colornames, please refer to the Xlib manuals.

display= display_object_name sets the display instance variable.

display? returns the value of the display instance variable on the argument stack.

freeable= sets the freeable instance variable.

freeable? gets the freeable instance variable.

free_cell! attempts to free the cell for the pixel value. If the colormap is not writeable or if it is a default colormap, the cell will not be freed.

pixel= pixel_value sets the pixel instance variable.

pixel? returns the value of the pixel instance variable on the argument stack.

rgb: rgb allocates a shared cell for the rgb specified. If the exact color cannot be allocated, the workstations closest color will be allocated. Each rgb value should be in the range 0 <= rgb_value <= 1. Note that this is different from Xlib where the range is 0 <= Xlib_rgb_value <= 65535.

rgb? returns the rgb of the shared cell on the argument stack.

screen? retreives the screen instance variable.

screen= sets the screen instance variable. Note: timing is important. You must set the screen before allocation.

EXAMPLE

/* create a xshared_cell an get pixels for red and green */ scalar new: red_pixel; scalar new: green_pixel;

xshared_cell new: the_cell

color: red;

red_pixel = [the_cell pixel?];

the_cell rgb: (0, 1, 0);

green_pixel = [the_cell pixel?];

SEE ALSO

xdisplay, xshared_cells, xcolormap, xprivate_cells


Last Updated On: Fri Mar 10 15:38:49 1995

Please send comments and suggestions to

its-documentation@rpi.edu

Keyword Search of RPInfo Consulting Pages and NewsCache