Skip to main content
Also has everything from ElementHandle. A clickable button. No value of its own, so use OnClick to run code.

Creation


SetIcon

Change the button’s icon. Pass nil to remove.

OnClick

Run cb() when the button is clicked.
() -> ()
Unsubscribe function.

RequireConfirm

Make the button require two clicks: the first arms it, the second confirms. Default prompt is "Confirm?", default timeout is 2.5 seconds.

ClearConfirm

Cancel the armed state.

Click

Trigger the click programmatically.
Also has everything from ElementHandle: labels, visibility, tooltips, and Destroy. There is no GetValue / OnChange on a button.

Example