FutureBasic Logo

<<    Index    >> FutureBasic

switch   statement / function

Statement syntax
switch tag, enabled, state, rect, wndTag

Function syntax
state = switch(tag)

macOS 10.15+

The switch statement puts a new switch control in the current output window, or alters an existing switch control's characteristics. The switch function returns the state of the switch control and is equivalent to calling fn SwitchState.

tag A number (1 through 1000000) that you assign when you create the switch control and that you refer to when altering the control. 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 control.
enabled A boolean value which specifies whether the switch should be enabled or disabled.
state The current state of the switch (default = NSControlStateValueOff).
rect The switch control'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 control.
(ii) A CGRect value
wndTag An optional parameter for when the switch control'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 event

Apple documentation