Skip to content

Properties

nicolaspayette edited this page Dec 5, 2014 · 21 revisions

Color, Commands, Enabled?, Font-color, Font-size, Height, Hidden?, Increment, Items, Key, Kind, Label, Maximum, Minimum, Opaque?, Order, Selected-item, Selected-items, Selected?, Tab, Text, Title, Units, Value, Width, X, Y


Color

The background color of the widget.

For widgets with the Opaque? property, xw:opaque? need to be true for the background color to be apparent.

Getter Setter Type Applies To
xw:color xw:set-color Color Tab, Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Commands

The commands to be run when a button is clicked.

Those commands are provided as a string that is not pre-compiled: if there are errors in the command, you will only find out at runtime. (This is similar to using run with a string).

Getter Setter Type Applies To
xw:commands xw:set-commands String Button.

Enabled?

A widget that is enabled allows user to change the value(s) entered in the widget. A widget that is disabled... doesn't. A disabled widget still appears on the screen, but it is grayed out and cannot be changed until it is enabled again.

For a Note, with which no user interaction is possible anyway, disabling it only makes it appear grayed out.

Note that calling xw:set-enabled? false on a Tab will make all the widgets on that tab appear disabled without affecting their Enabled? property. This way, if you later re-enable the tab, you will get the same mixture of enabled/disabled widgets that you had before disabling the tab. If you do want to individually disable all the widgets on a tab, you can do: xw:ask xw:widgets xw:with [ xw:tab = "my-tab" ] [ xw:set-enabled? false ].

Getter Setter Type Applies To
xw:enabled? xw:set-enabled? Boolean Tab, Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Font-color

The color of the font for text displayed on the widgets.

Getter Setter Type Applies To
xw:font-color xw:set-font-color Color Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Font-size

The size of the font for text displayed on the widgets.

The font size cannot be smaller than 1.

Getter Setter Type Applies To
xw:font-size xw:set-font-size Number Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Height

The height of a widget, in pixels.

A common use of this property is [ xw:height + xw:y ] xw:of "widget", which gives you the bottom coordinate of a widget, which you can use to position another widget under it.

Getter Setter Type Applies To
xw:height xw:set-height Number Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Hidden?

Whether a widget is hidden or not.

A hidden widget is not visible to the user, but its properties can still be manipulated through code.

Getter Setter Type Applies To
xw:hidden? xw:set-hidden? Boolean Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Increment

The number by which the value of a Slider is changed when a user moves it.

Getter Setter Type Applies To
xw:increment xw:set-increment Number Slider.

Items

The list of items available to select in a Chooser or Multi-Chooser.

Getter Setter Type Applies To
xw:items xw:set-items List Chooser, Multi-Chooser.

Key

The string by which a widget or tab is uniquely identified.

You need to provide a key when you create a widget through xw:create-<kind>, but also when you want to manipulate one (or many) widgets with xw:ask, xw:get, xw:of, xw:remove, xw:set and xw:with. The xw:widgets and xw:<kinds> primitives report list of keys.

This property is read-only.

Getter Setter Type Applies To
xw:key None String Tab, Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Kind

A string description of the kind of a widget or tab.

For example, xw:widgets xw:with [ member? xw:kind ["SLIDER" "NUMERIC-INPUT"] ] is the equivalent of sentence xw:numeric-inputs xw:sliders.

This property is read-only.

Getter Setter Type Applies To
xw:kind None String Tab, Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Label

Getter Setter Type Applies To
xw:label xw:set-label String Button, Checkbox, Chooser, Multi-Chooser, Numeric Input, Slider, Text-Input.

Maximum

Getter Setter Type Applies To
xw:maximum xw:set-maximum Number Slider.

Minimum

Getter Setter Type Applies To
xw:minimum xw:set-minimum Number Slider.

Opaque?

Getter Setter Type Applies To
xw:opaque? xw:set-opaque? Boolean Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Order

Getter Setter Type Applies To
xw:order xw:set-order Number Tab.

Selected-item

Getter Setter Type Applies To
xw:selected-item xw:set-selected-item Any Chooser.

Selected-items

Getter Setter Type Applies To
xw:selected-items xw:set-selected-items List Multi-Chooser.

Selected?

Getter Setter Type Applies To
xw:selected? xw:set-selected? Boolean Checkbox.

Tab

Getter Setter Type Applies To
xw:tab xw:set-tab String Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Text

Getter Setter Type Applies To
xw:text xw:set-text String Note, Text-Input.

Title

Getter Setter Type Applies To
xw:title xw:set-title String Tab.

Units

Getter Setter Type Applies To
xw:units xw:set-units Number Slider.

Value

Getter Setter Type Applies To
xw:value xw:set-value Number Numeric Input, Slider.

Width

The width of a widget, in pixels.

A common use of this property is [ xw:width + xw:y ] xw:of "widget", which gives you the right coordinate of a widget, which you can use to position another widget beside it.

Getter Setter Type Applies To
xw:width xw:set-width Number Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

X

Getter Setter Type Applies To
xw:x xw:set-x Number Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.

Y

Getter Setter Type Applies To
xw:y xw:set-y Number Button, Checkbox, Chooser, Multi-Chooser, Note, Numeric Input, Slider, Text-Input.
Clone this wiki locally