Skip to content

ButtonState

Narta Xaymar Dirks edited this page Nov 25, 2026 · 6 revisions

ButtonState BlitzPlus

ButtonState:Int32 button:Int32
Parameter Mode Type Default Description
button In Int32 required Handle of a button made with style 2 or 3.

Returns: 1 if it is ticked, 0 if not.

Description

Says whether a check box or radio button is ticked. The state of normal buttons is always 0.

Examples

Graphics 320, 240, 32, 2
win = CreateWindow("Check", 10, 10, 300, 120, Desktop(), 3)
box = CreateButton("Sound on", 10, 10, 200, 24, win, 2)
SetButtonState box, True
Repeat
	e = WaitEvent()
	If e = $401 And EventSource() = box Then SetGadgetText win, "State " + ButtonState(box)
Until e = $803

Related Commands

ActivateGadget BlitzPlus, AddGadgetItem BlitzPlus, CreateButton BlitzPlus, SetButtonState BlitzPlus

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally