class PtGraphic PtBasic { dash_list; // char array (Pt_ARG_DASH_LIST) dash_scale; // long (Pt_ARG_DASH_SCALE) graphic_flags; // flag (Pt_ARG_GRAPHIC_FLAGS) line_cap; // unsigned short (Pt_ARG_LINE_CAP) line_join; // unsigned short (Pt_ARG_LINE_JOIN) line_width; // long (Pt_ARG_LINE_WIDTH) origin; // PhPoint (Pt_ARG_ORIGIN) points; // PhPoint array (Pt_ARG_POINTS) }
This widget serves as a parent class of resources for graphic widgets, and is not normally instantiated. The variables here have to do mainly with line origins, thicknesses, joints and caps, as well as fill colors for closed shapes.
![]() | For detailed information, please refer to PtGraphic in the Photon documentation. |
![]() | Setting this variable to an array of length 0 with a Gamma statement like this: GraphicInstance.dash_list = array(0); will cause undefined behavior. To reset the default, use array(). |
| Constant | Description |
|---|---|
| Pt_FLOAT_POS | Allow the position and origin of the widget to change, leaving the graphic fixed to the parent. |
| Pt_FLOAT_ORIGIN | Allow the origin of the graphic to change, leaving the position of the widget fixed to the parent. |
| Constant | Description |
|---|---|
| Pg_BUTT_CAP | The default, leaves line capless, with square-cut ends. |
| Pg_ROUND_CAP | Puts a round cap on thick lines. |
| Pg_SQUARE_CAP | Puts a square cap on thick lines. |
| Constant | Description |
|---|---|
| Pg_MITER_JOIN | Makes a squared-off joint. |
| Pg_ROUND_JOIN | Makes a small-radius rounded joint. |
| Pg_BEVEL_JOIN | Makes a beveled joint. |
| Pg_QROUND_JOIN | Makes a large-radius rounded joint. |
| Pg_BUTT_JOIN | Makes a butt joint (outside line edges don't join). |
This example, ex_PtGraphics.g, is included in the product distribution.
#!/usr/cogent/bin/phgamma
/*
* This example illustrates dash variables for graphic lines.
*/
require_lisp("PhotonWidgets.lsp");
require_lisp("PhabTemplate.lsp");
PtInit(nil);
wfile = PhabReadWidgetFile (string(_os_, "-WidgetFiles/wgt/graphics.wgtw"));
window = PhabCreateWidgets(wfile, nil, nil);
win = PhabLookupWidget(window,#graphics,nil);
ln0 = PhabLookupWidget(window,#Line0,nil);
ln1 = PhabLookupWidget(window,#Line1,nil);
ln2 = PhabLookupWidget(window,#Line2,nil);
ln3 = PhabLookupWidget(window,#Line3,nil);
ln4 = PhabLookupWidget(window,#Line4,nil);
ln5 = PhabLookupWidget(window,#Line5,nil);
ebut = PhabLookupWidget(window,#ExitButton,nil);
PtAttachCallback(ebut, Pt_CB_ACTIVATE, #exit_program(1));
ln0.dash_list = array();
ln1.dash_list = array(20);
ln2.dash_list = array(20,5);
ln3.dash_list = array(20,5,20);
ln4.dash_list = array(20);
ln4.dash_scale = 0x00020000;
ln5.dash_list = array(20);
ln5.dash_scale = 0x00004000;
PtRealizeWidget(win);
PtMainLoop();
Copyright © 1995-2006 by Cogent Real-Time Systems, Inc. All rights reserved.