About all my projects
Gnome::Gtk4::EditableLabel

Gnome::Gtk4::EditableLabel

Description

A Gnome::Gtk4::EditableLabel is a label that allows users to edit the text by switching to an “edit mode”.

No caption

Gnome::Gtk4::EditableLabel does not have API of its own, but it implements the Gnome::Gtk4::R-Editable interface.

The default bindings for activating the edit mode is to click or press the Enter key. The default bindings for leaving the edit mode are the Enter key (to save the results) or the Escape key (to cancel the editing).

CSS nodes

Gnome::Gtk4::EditableLabel has a main node with the name editablelabel. When the entry is in editing mode, it gets the .editing style class.

For all the subnodes added to the text node in various situations, see Gnome::Gtk4::Text.

Class initialization

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-editablelabel

Creates a new Gnome::Gtk4::EditableLabel widget.

method new-editablelabel ( Str $str --> Gnome::Gtk4::EditableLabel \)
  • $str; the text for the label.

Methods

get-editing

Returns whether the label is currently in “editing mode”.

method get-editing (--> Bool )

Return value; True if $self is currently in editing mode.

start-editing

Switches the label into “editing mode”.

method start-editing ( )

stop-editing

Switches the label out of “editing mode”.

If $commit is True, the resulting text is kept as the text defined in Gnome::Gtk4::R-Editable property value, otherwise the resulting text is discarded and the label will keep its previous text defined in Gnome::Gtk4::R-Editable property value.

method stop-editing ( Bool() $commit )
  • $commit; whether to set the edited text on the label.