Back
This package is still under development. Contributions are welcome from anyone able to fill in some of the missing parts.
add Add a style, a menu item to a menu, etc. border Declare a border variable. button Declare a button variable. canvas Declare a canvas variable. center Center a component on a given point. color Declare a color variable. combobox Declare a combobox variable. create Create a component. cursor Declare a cursor variable. deselect Deselect a button. disable Disable a button. enable Enable a button. find Find which element in an array caused an event. font Declare a font variable. hide hide a component. image Declare and pre-initialize a constant image. label Declare a label variable. menu Declare a menu variable. menuitem Declare a menuitem variable. move Move a component. on Handle a graphics event. popupmenu Declare a popupmenu variable. select Select a button. set Set the value or an attribute of something. show Shoe a component (make it visible). style Declare a style variable. styledtext Declare a styledtext variable. textarea Declare a textarea variable. textfield Declare a textfield variable. textpanel Declare a textpanel variable. window Declare a window variable.
Numeric values
String values
Conditional expressions
These values can be used in either a numeric or string expression:
the screen size/width/height
Returns the size, width or height of the screen. The latter two can be transferred to a variable
and used in subsequent calculations, while the the screen size can only be used directly,
as in set the size of Button1 to the size of Button2.
the left/top/right/bottom/width/height of {component}
Returns the appropriate measurement for the component.
the content width/height of {component}
Returns the width or height of the content area (taking regard of insets) of the component.
the left/right/top/bottom inset of {component}
Returns the appropriate inset for the component. In the case of a window, this
is the width or height of the frame border currently in effect.
the mouse left/top
Returns the current location of the mouse. This can only be used inside a callback generated as a result
of a mouse event in a component - see on.
the key code
Returns an integer value being the code for the key just pressed. This can only be used inside a callback
generated as a result of a key pressed or key released event in a component - see on.
the selection index of {combobox}
Returns an integer value being the index of the selected item in the combobox.
If no item is selected, -1 is returned.
These values can be used in a string expression:
the key char
Returns the character for the key just pressed. This can only be used inside a callback generated as a result
of a key typed event in a component - see on.
the target
Returns the contents of the tag that generated the callback we're in. - see style.
This can only be used inside a callback generated as a result of a mouse click in a textpanel - see on.
the description of {component}
Returns the text that was previously associated with the component using set the description of {component}. See set.
the action of {button}/{menu item}
Returns the action string corresponding to that button or menuitem.
The graphics package recognizes the following conditional expressions, which may be used in an if or while command:
[not] right button
Tests if the last mouse button pressed was the right one (button 2).
{button} is [not] selected
Tests if the named button is (or is not) selected.
{component} is [not] visible
Tests if the named component (button, label etc.)
is (or is not) visible.
{button} is [not] on/off
Tests if the named button is (or is not) on or off, as determined by what
was passed to the button in a set the status of {button}
command. See set.