EditableLabel#
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
, Editable
A GtkEditableLabel
is a label that allows users to
edit the text by switching to an “edit mode”.
GtkEditableLabel
does not have API of its own, but it
implements the 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).
Shortcuts and Gestures#
GtkEditableLabel
supports the following keyboard shortcuts:
Enter starts editing.
Escape stops editing.
Actions#
GtkEditableLabel
defines a set of built-in actions:
editing.starts
switches the widget into editing mode.editing.stop
switches the widget out of editing mode.
CSS nodes#
editablelabel[.editing]
╰── stack
├── label
╰── text
GtkEditableLabel
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 Text
.
Constructors#
Methods#
- class EditableLabel
-
- stop_editing(commit: bool) None #
Switches the label out of “editing mode”.
If
commit
isTrue
, the resulting text is kept as thetext
property value, otherwise the resulting text is discarded and the label will keep its previoustext
property value.- Parameters:
commit – whether to set the edited text on the label