PtBkgd

PtBkgd -- A background image, bitmap, or color-gradient.

Synopsis

class PtBkgd PtPane
{
    bkgd_brt_from;       // unsigned short  (Pt_ARG_BKGD_BRT_FROM)    
    bkgd_brt_to;         // unsigned short  (Pt_ARG_BKGD_BRT_TO)    
    bkgd_hue_from;       // unsigned short  (Pt_ARG_BKGD_HUE_FROM)    
    bkgd_hue_to;         // unsigned short  (Pt_ARG_BKGD_HUE_TO)    
    bkgd_image;          // PhImage  (Pt_ARG_BKGD_IMAGE)    
    bkgd_mix;            // unsigned short  (Pt_ARG_BKGD_MIX)    
    bkgd_orientation;    // unsigned short  (Pt_ARG_BKGD_ORIENTATION)    
    bkgd_pix_height;     // unsigned short  (Pt_ARG_BKGD_PIX_HEIGHT)    
    bkgd_pix_width;      // unsigned short  (Pt_ARG_BKGD_PIX_WIDTH)    
    bkgd_pixcolors;      // color array  (Pt_ARG_BKGD_PIXCOLORS)    
    bkgd_pixmap;         // char array array  (Pt_ARG_BKGD_PIXMAP)    
    bkgd_sat_from;       // unsigned short  (Pt_ARG_BKGD_SAT_FROM)    
    bkgd_sat_to;         // unsigned short  (Pt_ARG_BKGD_SAT_TO)    
    bkgd_spacing;        // PhPoint  (Pt_ARG_BKGD_SPACING)    
    bkgd_steps;          // unsigned short  (Pt_ARG_BKGD_STEPS)    
    bkgd_tile;           // unsigned short  (Pt_ARG_BKGD_TILE)    
    bkgd_type;           // unsigned short  (Pt_ARG_BKGD_TYPE)    
}
		

Base Classes

PtWidget <-- PtBasic <-- PtContainer <-- PtPane <-- PtBkgd

Description

This widget lets you make backgrounds for application windows. The bkgd_type variable lets you choose from three types of backgrounds: images, pixmaps, and color-gradients, which are controlled with their associated variables.

Note

For detailed information, please refer to PtBkgd in the Photon documentation.

Instance Variables

bkgd_brt_from, bkgd_brt_to

An integer between 0 and 255 specifying the brightness range (black to full brightness) of color gradients, using the hue/saturation/brightness color model.

bkgd_hue_from, bkgd_hue_to

An integer between 0 and 65535 specifying the hue range (on the color spectrum) of color gradients, using the hue/saturation/brightness color model.

bkgd_image

A PhImage that you wish to display.

bkgd_mix

An integer that specifies whether or not dithering is used in color-gradient backgrounds. 1 (the default) is on, 0 is off.

bkgd_orientation

A constant specifying the orientation of color-gradient backgrounds. The default is vertical.

This instance variable may have one of the following values:

bkgd_pix_height, bkgd_pix_width

A number of pixels specifying the height and width of a pixmap image.

bkgd_pixcolors

An array of colors used by a pixmap image.

bkgd_pixmap

A bitmapped background image created in PhAB. This type of image can be easily made transparent.

bkgd_sat_from, bkgd_sat_to

An integer between 0 and 255 specifying the saturation range (white to full color) of color gradients, using the hue/saturation/brightness color model.

bkgd_spacing

A PhPoint whose x and y values specify the horizontal and vertical separation between tiles. Default is:

    {PhPoint (x	. 0) (y . 0)}
bkgd_steps

An integer specifying the number of steps to get from the minimum gradient value to the maximum. Default is 10.

bkgd_tile

A constant specifying the tiling option for images and pixmaps.

This instance variable may have one of the following values:

bkgd_type

A constant specifying the type of background image you want to use. The relevance of other variables depends on this choice.

This instance variable may have one of the following values:

Example

This example, ex_PtBkgd.g, is included in the gamma_ph_#_examples_1_QNX4.tgz file available on the Cogent Web Site.

#!/usr/cogent/bin/phgamma

/*
 * This example demonstrates a saturation color_gradient
 * PtBkgd anchored to a window.
 */

require_lisp("PhotonWidgets.lsp");
PtInit(nil);

win = new(PtWindow);
win.SetDim (300,300);

back = new(PtBkgd);
back.bkgd_type = Pt_BKGD_SATURATION;
back.bkgd_brt_to = 255;
back.bkgd_hue_to = 30000;
back.bkgd_sat_from = 255;
back.bkgd_sat_to = 0;
back.bkgd_steps = 200;
back.SetDim(300,300);
back.bkgd_orientation = Pt_BKGD_HORIZONTAL;
back.anchor_flags = Pt_LEFT_ANCHORED_RELATIVE |
                    Pt_RIGHT_ANCHORED_RELATIVE |
		    Pt_TOP_ANCHORED_RELATIVE |
		    Pt_BOTTOM_ANCHORED_RELATIVE;

PtRealizeWidget(win);
PtMainLoop(); 
		

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.