Class EditableLabel

All Implemented Interfaces:
PointerInterface

public class EditableLabel extends Widget
A `GtkEditableLabel` is a label that allows users to
edit the text by switching to an “edit mode”.

![An example GtkEditableLabel](editable-label.png)

`GtkEditableLabel` does not have API of its own, but it
implements the [iface@Gtk.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

```
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 [class@Gtk.Text].

https://docs.gtk.org/gtk4/class.EditableLabel.html

  • Constructor Details

    • EditableLabel

      public EditableLabel(PointerContainer pointer)
    • EditableLabel

      public EditableLabel(@Nonnull Str str)
      Creates a new `GtkEditableLabel` widget.
      Parameters:
      str - the text for the label
    • EditableLabel

      public EditableLabel(String str)
      Creates a new `GtkEditableLabel` widget.
      Parameters:
      str - the text for the label
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getEditing

      public boolean getEditing()
      Returns whether the label is currently in “editing mode”.
      Returns:
      %TRUE if @self is currently in editing mode
    • startEditing

      public void startEditing()
      Switches the label into “editing mode”.
    • stopEditing

      public void stopEditing(boolean commit)
      Switches the label out of “editing mode”.

      If @commit is %TRUE, the resulting text is kept as the
      [property@Gtk.Editable:text] property value, otherwise the
      resulting text is discarded and the label will keep its
      previous [property@Gtk.Editable:text] property value.
      Parameters:
      commit - whether to set the edited text on the label
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      Returns:
      ConstraintTarget
    • asEditable

      public Editable asEditable()
      Implements interface Editable. Call this to get access to interface functions.
      Returns:
      Editable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()