It derives from <GtkWidget>.
Calls a callback function when the button is clicked.
The <GtkButton> widget can hold any valid child
widget. That is, it can hold almost any other standard
<GtkWidget>. The most commonly used child is the
<GtkLabel>.
The following signals have default keybindings:
<GtkButton> has a single CSS node with name button.
The node will get the style classes .image-button or .text-button, if
the content is just an image or label, respectively. It may also
receive the .flat style class. When activating a button via the
keyboard, the button will temporarily gain the .keyboard-activating
style class.
Other style classes that are commonly used with
<GtkButton> include .suggested-action and
.destructive-action. In special cases, buttons can be made round by
adding the .circular style class.
Button-like widgets like <GtkToggleButton>,
<GtkMenuButton>, <GtkVolumeButton>,
<GtkLockButton>, <GtkColorButton> or
<GtkFontButton> use style classes such as .toggle, .popup,
.scale, .lock, .color on the button node to differentiate themselves
from a plain <GtkButton>.
<GtkButton> uses the
Gtk.AccessibleRole.button role.
Whether the size of the button can be made smaller than the natural size of its contents.
For text buttons, setting this property will allow ellipsizing the label.
If the contents of a button are an icon or a custom widget, setting this property has no effect.
Its value is a boolean.
Set it with (set! (button:can-shrink self) value).
The child widget.
Its value is a <GtkWidget>, or #f.
Set it with (set! (button:child self) value).
Whether the button has a frame.
Its value is a boolean.
Set it with (set! (button:has-frame self) value).
The name of the icon used to automatically populate the button.
Its value is a string, or #f.
Set it with (set! (button:icon-name self) value).
Text of the label inside the button, if the button contains a label widget.
Its value is a string, or #f.
Set it with (set! (button:label self) value).
If set, an underline in the text indicates that the following character is to be used as mnemonic.
Its value is a boolean.
Set it with (set! (button:use-underline self) value).
Retrieves whether the button can be smaller than the natural size of its contents.
Passed: a <GtkButton>.
a button
Returned: a boolean.
true if the button can shrink, and false otherwise
Gets the child widget of self.
Passed: a <GtkButton>.
Returned: a <GtkWidget>, or #f.
the child widget of self
Returns whether the button has a frame.
Passed: a <GtkButton>.
Returned: a boolean.
#t if the button has a frame
Returns the icon name of the button.
If the icon name has not been set with button:set-icon-name the return value will be
#f. This will be the case if you create an empty button with
button:new to use as a container.
Passed: a <GtkButton>.
Returned: a string, or #f.
The icon name set via button:set-icon-name
Fetches the text from the label of the button.
If the label text has not been set with button:set-label the return value will be #f. This
will be the case if you create an empty button with button:new to use as a container.
Passed: a <GtkButton>.
Returned: a string, or #f.
The text of the label widget. This string is owned by the widget and must not be modified or freed.
gets whether underlines are interpreted as mnemonics.
Passed: a <GtkButton>.
Returned: a boolean.
#t if an embedded underline in the button label indicates the
mnemonic accelerator keys.
Creates a new <GtkButton> widget.
To add a child widget to the button, use button:set-child.
Returned: a <GtkWidget>.
The newly created <GtkButton> widget.
Creates a new button containing an icon from the current icon theme.
If the icon name isn’t known, a “broken image” icon will be displayed instead. If the current icon theme is changed, the icon will be updated appropriately.
Passed: a string.
an icon name
Returned: a <GtkWidget>.
a new <GtkButton> displaying the themed icon
Creates a <GtkButton> widget with a
<GtkLabel> child.
Passed: a string.
The text you want the <GtkLabel> to hold
Returned: a <GtkWidget>.
The newly created <GtkButton> widget
Creates a new <GtkButton> containing a label.
If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use “__” (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the button.
Passed: a string.
The text of the button, with an underscore in front of the mnemonic character
Returned: a <GtkWidget>.
a new <GtkButton>
Sets whether the button size can be smaller than the natural size of its contents.
For text buttons, setting can-shrink to true will ellipsize the label.
For icons and custom children, this function has no effect.
Passed: a <GtkButton>.
a button
Passed: a boolean.
whether the button can shrink
Sets the child widget of self.
Note that by using this API, you take full responsibility for setting up the proper accessibility label and description information for self. Most likely, you’ll either set the accessibility label or description for self explicitly, or you’ll set a labelled-by or described-by relations from child to self.
Passed: a <GtkButton>.
Passed, or left out: a <GtkWidget>, or #f.
the child widget
Sets the style of the button.
Buttons can have a flat appearance or have a frame drawn around them.
Passed: a <GtkButton>.
Passed: a boolean.
whether the button should have a visible frame
Adds a <GtkImage> with the given icon name as a
child.
If self already contains a child widget, that child widget will be removed and replaced with the image.
Passed: a <GtkButton>.
Passed: a string.
An icon name
Sets the text of the label of the button to label.
This will also clear any previously set labels.
Passed: a <GtkButton>.
Passed: a string.
a string
Sets whether to use underlines as mnemonics.
If true, an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key.
Passed: a <GtkButton>.
Passed: a boolean.
#t if underlines in the text indicate mnemonics
Connect a handler with (connect object button:activate handler).
It is called as (handler self).
Emitted to animate press then release.
This is an action signal. Applications should never connect to this
signal, but use the button:clicked
signal.
The default bindings for this signal are all forms of the ␣ and Enter keys.
Passed: a <GtkButton>.
Connect a handler with (connect object button:clicked handler).
It is called as (handler self).
Emitted when the button has been activated (pressed and released).
Passed: a <GtkButton>.
Signal that causes the button to animate press then release. Applications should never connect to this signal, but use the clicked signal.
To override it in a new class, give register-type #:vfuncs
`((activate . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GtkButton>, or a class that derives from it, or
its GType number.
Passed: a <GtkButton>.
Signal emitted when the button has been activated (pressed and released).
To override it in a new class, give register-type #:vfuncs
`((clicked . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GtkButton>, or a class that derives from it, or
its GType number.
Passed: a <GtkButton>.