Gtk.EditableLabel¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Editable (27)
- Structs:
class |
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.EditableLabel(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A
GtkEditableLabel
is a label that allows users to edit the text by switching to an “edit mode”.An example
Gtk.EditableLabel
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].
- classmethod new(str)[source]¶
- Parameters:
str (
str
) – the text for the label- Returns:
the new
GtkEditableLabel
- Return type:
Creates a new
GtkEditableLabel
widget.
- stop_editing(commit)[source]¶
- Parameters:
commit (
bool
) – whether to set the edited text on the label
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.