FutureBasic Logo

<<    Index    >> FutureBasic

TokenField   statement / function

Statement syntax
tokenfield tag, enabled, text, rect, style, wndTag

Function syntax
text = tokenfield(tag)

The tokenfield statement puts a new tokenfield in the current output window, or alters an existing tokenfield's characteristics. The tokenfield function returns the field's text as a CFStringRef and is equivalent to calling fn ControlStringValue.

tag A number (1 through 1000000) that you assign when you create the tokenfield and that you refer to when altering the field. The number you assign must be different from the tag value of all other existing widgets in the current window. A negative tag hides the tokenfield.
enabled A boolean value which specifies whether the tokenfield should be enabled or disabled.
text The text that appears inside the tokenfield.
rect The tokenfield's enclosing rectangle. This can be specified in either of two ways:
(i) (x,y,w,h) where x,y are the origin and w,h the size of the field.
(ii) A CGRect value
style Specifies the style of the tokenfield:
NSTokenStyleDefault (default)
NSTokenStylePlainSquared // macOS 10.10+
NSTokenStyleSquared // macOS 10.10+
wndTag An optional parameter for when the tokenfield's window is not the current output window. Note specifying this parameter does not bring the window to the front or make it the output window.
Dialog events
See: textfield

See also
Apple documentation