FutureBasic Logo

<<    Index    >> FutureBasic

button   statement / function



Statement syntax
button tag, enabled, state, title, rect, type, style, wndTag

Function syntax
state = button(tag)

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

Parameters
Parameter
Description
tag A number (1 through 1000000) that you assign when you create the button and that you refer to when altering or closing the button. 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 button.
enabled A boolean value which specifies whether the button should be enabled or disabled.
state The button state:
NSControlStateValueOn
NSControlStateValueOff (default)
NSControlStateValueMixed
title The text that appears inside the button (in the case of push buttons) or to the right of the button (in the case of checkboxes and radio buttons) as a CFString expression.
rect The button'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 button.
(ii) A CGRect value
type The button type:
NSButtonTypeMomentaryLight (default)
NSButtonTypeSwitch
NSButtonTypeRadio
NSButtonTypePushOnPushOff
NSButtonTypeToggle
NSButtonTypeMomentaryChange
NSButtonTypeOnOff
NSButtonTypeMomentaryPushIn
NSButtonTypeAccelerator
NSButtonTypeMultiLevelAccelerator
style The button style:
NSBezelStyleRounded (default)
NSBezelStyleRegularSquare
NSBezelStyleDisclosure
NSBezelStyleShadowlessSquare
NSBezelStyleCircular
NSBezelStyleTexturedSquare
NSBezelStyleHelpButton
NSBezelStyleSmallSquare
NSBezelStyleTexturedRounded
NSBezelStyleRoundRect
NSBezelStyleRecessed
NSBezelStyleRoundedDisclosure
NSBezelStyleInline
wndTag An optional parameter for when the button'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
_btnClick
 

See also
checkbox; radiobutton

Apple documentation
NSButton