About all my projects
Gnome::Gtk4::CellRendererToggle

Gnome::Gtk4::CellRendererToggle

Description

Renders a toggle button in a cell

Gnome::Gtk4::CellRendererToggle renders a toggle button in a cell. The button is drawn as a radio or a checkbutton, depending on the Gnome::Gtk4::CellRendererToggle:radio` property. When activated, it emits the Gnome::Gtk4::CellRendererToggle::toggled` signal.

Class initialization

Note: The native version of this class is deprecated in gtk4-lib() since version 4.10

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

new-cellrenderertoggle

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Creates a new Gnome::Gtk4::CellRendererToggle. Adjust rendering parameters using object properties. Object properties can be set globally (with g_object_set()). Also, with Gnome::Gtk4::TreeViewColumn, you can bind a property to a value in a Gnome::Gtk4::R-TreeModel. For example, you can bind the “active” property on the cell renderer to a boolean value in the model, thus causing the check button to reflect the state of the model.

method new-cellrenderertoggle ( --> Gnome::Gtk4::CellRendererToggle \)

Methods

get-activatable

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Returns whether the cell renderer is activatable. See .set-activatable().

method get-activatable (--> Bool )

Return value; True if the cell renderer is activatable..

get-active

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Returns whether the cell renderer is active. See .set-active().

method get-active (--> Bool )

Return value; True if the cell renderer is active..

get-radio

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Returns whether we’re rendering radio toggles rather than checkboxes.

method get-radio (--> Bool )

Return value; True if we’re rendering radio toggles rather than checkboxes.

set-activatable

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Makes the cell renderer activatable.

method set-activatable ( Bool() $setting )
  • $setting; the value to set..

set-active

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Activates or deactivates a cell renderer.

method set-active ( Bool() $setting )
  • $setting; the value to set..

set-radio

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

If $radio is True, the cell renderer renders a radio toggle (i.e. a toggle in a group of mutually-exclusive toggles). If False, it renders a check toggle (a standalone boolean option). This can be set globally for the cell renderer, or changed just before rendering each cell in the model (for Gnome::Gtk4::TreeView, you set up a per-row setting using Gnome::Gtk4::TreeViewColumn to associate model columns with cell renderer properties).

method set-radio ( Bool() $radio )
  • $radio; True to make the toggle look like a radio button.

Signals

toggled

The toggled signal is emitted when the cell is toggled.

It is the responsibility of the application to update the model with the correct value to store at $path. Often this is simply the opposite of the value currently stored at $path.

method handler (
  Str $path,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::CellRendererToggle :$_widget,
  *C<user>-options
)
  • $path; string representation of Gnome::Gtk4::N-TreePath describing the event location.

  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::CellRendererToggle object.

  • $_widget; The object which registered the signal. User code may have left the object going out of scope.

  • user-options; A list of named arguments provided at the .register-signal() method from Gnome::GObject::Object.