1.53 <GtkEditableLabel>

Class: <GtkEditableLabel>

It derives from <GtkWidget>.

Allows users to edit the displayed text by switching to an “edit mode”.

<GtkEditableLabel> does not have API of its own, but it implements the <GtkEditable> 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 <GtkText>.

Properties

Property: editable-label:editing self

This property is #t while the widget is in edit mode.

Its value is a boolean.

Set it with (set! (editable-label:editing self) value).

Procedures

Method: editable-label:get-editing? self ⇒ %return
Method: get-editing? self ⇒ %return

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

self

Passed: a <GtkEditableLabel>.

a <GtkEditableLabel>

%return

Returned: a boolean.

#t if self is currently in editing mode

Procedure: editable-label:new str ⇒ %return

Creates a new <GtkEditableLabel> widget.

str

Passed: a string.

the text for the label

%return

Returned: a <GtkWidget>.

the new <GtkEditableLabel>

Method: editable-label:start-editing self
Method: start-editing self

Switches the label into “editing mode”.

self

Passed: a <GtkEditableLabel>.

a <GtkEditableLabel>

Method: editable-label:stop-editing self commit
Method: stop-editing self commit

Switches the label out of “editing mode”.

If commit is #t, the resulting text is kept as the editable:text property value, otherwise the resulting text is discarded and the label will keep its previous editable:text property value.

self

Passed: a <GtkEditableLabel>.

a <GtkEditableLabel>

commit

Passed: a boolean.

whether to set the edited text on the label