Syntax:
set the title of {window} to {title} set the layout of {window} to flow... set the size of {component} to {size} set the location of {component} to {location} set the text of {component} to {text} set the name of {style} to {text} set the icon of {label] to {name} set the default/selected/pressed/ disabled [selected]/rollover [selected] icon of {button] to {name} set the border of {component} to {border}/none set the cursor of {component}/{style} to {cursor} set the style of {component} to opaque/transparent set the background/foreground color/colour of {component} to {color} set the description of {component} to {text} set the status of {component} to on/off/{value} set the font of {component} to {font} set the color/colour of {font} to {color} set the tooltip of {component} to {text} set the caret color/colour of {text component} to {color} set the alpha of {2D component} to {value} set the horizontal/vertical text alignment of {label}/{button} to left/right/top/bottom/center/centre
Keyword handler:
net.eclecity.linguist.graphics.keyword.GraphicsKSet.class
Runtime handler(s):
net.eclecity.linguist.graphics.handler.GraphicsHSet.class
Function:
There are many functions associated with the set command, as follows:
set the title of {window} controls the text that will appear in the window's title bar.
set the layout of {window} allows you to specify that a Layout Manager should be used with the window. Please consult a book on Java for an explanation of Layout Managers. The only layout that is currently implemented is flow. The default is no layout, where components have to be positioned manually.
set the size of {component} controls the size of a component.
set the location of {component} controls the location (position) of a component relative to its parent.
set the text of {component} assigns a text string to a component, useful for changing the content of a label or a button.
set the name of {style} assigns a text string to the style. When a tag comprising this string appears in a textpanel the rules for the style will be applied to the text.
set the icon of {label} assigns an icon to the label. The source is either a file name or an image constant.
set the xxx icon of {button} assigns an icon to the button. The source is either a file name or an image constant. A button can have up to six icons:
the default icon is shown when the button is inactive.
the selected icon is shown when the button is selected, either by clicking or under program control.
the pressed icon is shown when the button is pressed.
the disabled icon is shown when the button is disabled.
the disabled selected icon is shown when the button is disabled and selected.
the rollover icon is shown when the cursor moves over the button.
the rollover selected icon is shown when the button is selected and the cursor moves over it.
If you do not assign an icon for a state the button will use (generally sensible) defaults.
set the border of {component} assigns a border to a component.
set the cursor of {component}/{style} assigns a cursor to a component or to a style. This cursor will automatically appear when the mouse pointer moves over the component or over any text to which the style has been applied.
set the style of {component} allows you to specify if the component is transparent or opaque. For example, a label may have a transparent GIF applied as its icon (see above) but unless the label itself is transparent the background image will not show through.
set the background/foreground color of {component} assigns a default color to the component. The background color is shown in any part of the component not filled by another component; the foreground color applies to any text or graphic primitives drawn in the component, unless explicitly overridden.
set the description of {component} allows you to store a descriptive (or other) string in the component itself. The corresponding value to use in expressions and assignments is the description of {component} - what you use this for is up to you.
set the status of {component} allows you to store a numeric value in the component itself. The corresponding value to use in expressions and assignments is the status of {component} - what you use this for is up to you.
set the font of {component} specifies the font that will be used for drawing text in the component.
set the color/colour of {font} specifies the color associated with the specified font variable.
set the tooltip of {component} specifies that when the mouse pointer moves into the component a tooltip window should be drawn containing the text given. Tooltips appear after a fixed delay of about three-quarters of a second and hold for a few seconds before disappearing..
set the caret color/colour of {text component} allows you to specify the color the system should use when drawing the caret in a text component.
set the alpha of {2D component} allows you to specify the transparency of a canvas or styledtext object. Values range from zero (transparent) to 100 (opaque).
set the horizontal/vertical text alignment of {label}/{button} specifies the alignment of text within a label or button. The default is left alignment for labels and center alignment for buttons.
Example(s):
set the title of MainWindow to "Window #" cat N set the layout of MainWindow to flow set the background of MainWindow to "jpg/BG05.jpg" set the size of OKButton to 100 50 set the location of OKButton to 150 435 set the text of AddressLabel to "New Address:" set the name of HeaderStyle to "Header" set the icon of PhoneLabel to PHONE_IMAGE set the default icon of PlayButton to "controls/play.gif" set the border of PlayButton to BevelBorder set the cursor of PlayButton to HandCursor set the style of PhoneLabel to transparent set the background color of OKButton to Pink set the font of OKButton to BigLabelFont set the tooltip of PlayButton to "Click here to start the movie" set the horizontal alignment of AddressLabel to right