src/swipl-devel/packages/xpce/man/refmanual/md/button.md

class button {#class-button}

A button appears on the screen as a rectangle with a textual label. When the user presses the button, it will execute its associated message with the following parameters:

@receiver       The button itself

If <-message is @default, the button will send its <-name to its <-device. Thus, a button named apply will invoke ->apply on the dialog box it is displayed on.

A button may be assigned a key-sequence to activate it. See <-accelerator. If the <-accelerator is "RET" the button is the default button of its device and will be highlighted. See also dialog ->default_button).

A button may be assigned a popup menu using ->popup. Existence of a popup menu is indicated using a small triangle.

Bugs:

It is not possible to use an arbitrary bitmap as a button. Class label provides a (conceptually inferior) way to create active images.

@see class click_gesture

Instance variables {#class-button-instvars}

Send methods {#class-button-send}

Get methods {#class-button-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.