Top |
Functions
GtkWidget * | gtk_editable_label_new () |
gboolean | gtk_editable_label_get_editing () |
void | gtk_editable_label_start_editing () |
void | gtk_editable_label_stop_editing () |
Implemented Interfaces
GtkEditableLabel implements GtkAccessible, GtkBuildable, GtkConstraintTarget and GtkEditable.
Description
A GtkEditableLabel is a GtkLabel that allows users to edit the text by switching the widget 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).
CSS nodes
1 2 3 4 |
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.
Functions
gtk_editable_label_new ()
GtkWidget *
gtk_editable_label_new (const char *str
);
Creates a new GtkEditableLabel widget.
gtk_editable_label_get_editing ()
gboolean
gtk_editable_label_get_editing (GtkEditableLabel *self
);
Returns whether the label is currently in “editing mode”.
gtk_editable_label_start_editing ()
void
gtk_editable_label_start_editing (GtkEditableLabel *self
);
Switches the label into “editing mode”.
gtk_editable_label_stop_editing ()
void gtk_editable_label_stop_editing (GtkEditableLabel *self
,gboolean commit
);
Switches the label out of “editing mode”. If commit
is TRUE
,
the resulting text is kept as the “text” property
value, otherwise the resulting text is discarded and the label
will keep its previous “text” property value.
Action Details
The “editing.stop”
action
Switch the widget out of editing mode. If commit
is TRUE
, then the results of the editing are taken
as the new value of “text”.
The default binding for this action is the Escape key.
This action is disabled when “editing”
is FALSE
.
Parameter type: b
The “editing.start”
action
Switch the widget into editing mode, so that the user can make changes to the text.
The default bindings for this action are clicking on the widget and the Enter key.
This action is disabled when “editing”
is FALSE
.