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) }
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.
![]() | For detailed information, please refer to PtBkgd in the Photon documentation. |
| Constant | Description |
|---|---|
| Pt_BKGD_HORIZONTAL | Sets the gradient orientation to horizontal. |
| Pt_BKGD_VERTICAL | Sets the gradient orientation to vertical. |
{PhPoint (x . 0) (y . 0)}| Constant | Description |
|---|---|
| Pt_BKGD_NONE | None. |
| Pt_BKGD_GRID | The image repeats in rows and columns. |
| Pt_BKGD_ALT | The image repeats alternately, like brickwork. |
| Pt_BKGD_CENTER | The image is drawn in the center of the container. |
| Pt_BKGD_CENTER_GRID | The image is drawn in the center, and repeated for a single row and column around the border. |
| Constant | Description |
|---|---|
| Pt_BKGD_HUE | The background color gradient is based on hue value. |
| Pt_BKGD_SATURATION | The background color gradient is based on saturation value. |
| Pt_BKGD_BRIGHTNESS | The default, the background color gradient is based on brightness value. |
| Pt_BKGD_PIXMAP | Used to create a background of a small/hand-drawn image; background fill color stays visible. |
| Pt_BKGD_IMAGE | Used to create a background with an imported image. |
This example, ex_PtBkgd.g, is included in the product distribution.
#!/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-2006 by Cogent Real-Time Systems, Inc. All rights reserved.