Sets our main struct and passes it to the parent class.
Creates a new toggle button.
Creates a new GtkToggleButton containing a label.
Emitted whenever the GtkToggleButton's state is changed.
Queries a GtkToggleButton and returns its current state.
the main Gtk struct as a void*
Get the main Gtk struct
Sets the status of the toggle button.
Adds @self to the group of @group.
Emits the ::toggled signal on the GtkToggleButton.
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Gets the child widget of @button.
Returns whether the button has a frame.
Returns the icon name of the button.
Fetches the text from the label of the button.
gets whether underlines are interpreted as mnemonics.
Sets the child widget of @button.
Sets the style of the button.
Adds a GtkImage with the given icon name as a child.
Sets the text of the label of the button to @label.
Sets whether to use underlines as mnemonics.
Emitted to animate press then release.
Emitted when the button has been activated (pressed and released).
A GtkToggleButton is a button which remains “pressed-in” when clicked.
Clicking again will cause the toggle button to return to its normal state.
A toggle button is created by calling either [ctor@Gtk.ToggleButton.new] or [ctor@Gtk.ToggleButton.new_with_label]. If using the former, it is advisable to pack a widget, (such as a GtkLabel and/or a GtkImage), into the toggle button’s container. (See [class@Gtk.Button] for more information).
The state of a GtkToggleButton can be set specifically using [method@Gtk.ToggleButton.set_active], and retrieved using [method@Gtk.ToggleButton.get_active].
To simply switch the state of a toggle button, use [method@Gtk.ToggleButton.toggled].
Grouping
Toggle buttons can be grouped together, to form mutually exclusive groups - only one of the buttons can be toggled at a time, and toggling another one will switch the currently toggled one off.
To add a GtkToggleButton to a group, use [method@Gtk.ToggleButton.set_group].
CSS nodes
GtkToggleButton has a single CSS node with name button. To differentiate it from a plain GtkButton, it gets the .toggle style class.
Creating two GtkToggleButton widgets.