About all my projects
Gnome::Gtk4::CellRendererCombo

Gnome::Gtk4::CellRendererCombo

Description

Renders a combobox in a cell

Gnome::Gtk4::CellRendererCombo renders text in a cell like Gnome::Gtk4::CellRendererText from which it is derived. But while Gnome::Gtk4::CellRendererText offers a simple entry to edit the text, Gnome::Gtk4::CellRendererCombo offers a Gnome::Gtk4::ComboBox widget to edit the text. The values to display in the combo box are taken from the tree model specified in the Gnome::Gtk4::CellRendererCombo:model property.

The combo cell renderer takes care of adding a text cell renderer to the combo box and sets it to display the column specified by its Gnome::Gtk4::CellRendererCombo:text-column property. Further properties of the combo box can be set in a handler for the Gnome::Gtk4::CellRenderer::editing-started` 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-cellrenderercombo

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

Creates a new Gnome::Gtk4::CellRendererCombo. Adjust how text is drawn 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 “text” property on the cell renderer to a string value in the model, thus rendering a different string in each row of the Gnome::Gtk4::TreeView.

method new-cellrenderercombo ( --> Gnome::Gtk4::CellRendererCombo \)

Signals

changed

This signal is emitted each time after the user selected an item in the combo box, either by using the mouse or the arrow keys. Contrary to GtkComboBox, GtkCellRendererCombo::changed is not emitted for changes made to a selected item in the entry. The argument $new-iter corresponds to the newly selected item in the combo box and it is relative to the GtkTreeModel set via the model property on GtkCellRendererCombo.

Note that as soon as you change the model displayed in the tree view, the tree view will immediately cease the editing operating. This means that you most probably want to refrain from changing the model until the combo cell renderer emits the edited or editing_canceled signal.

method handler (
  Str $path-string,
  N-Object $new-iter,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::CellRendererCombo :$_widget,
  *C<user>-options
)
  • $path-string; a string of the path identifying the edited cell (relative to the tree view model).

  • $new-iter; the new iter selected in the combo box (relative to the combo box model).

  • $_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::CellRendererCombo 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.