Allows users to edit the displayed text by switching to an "edit mode".
<picture> <source srcset="editable-label-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkEditableLabel" src="editable-label.png"> </picture> GtkEditableLabel does not have API of its own, but it implements the [ifaceGtk.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:
<kbd>Enter</kbd> starts editing. - <kbd>Escape</kbd> 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 [classGtk.Text].
function "+"
(Widget : access Gtk_Editable_Label_Record'Class)
return Gtk.Accessible.Gtk_Accessible
function "+"
(Widget : access Gtk_Editable_Label_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Editable_Label_Record'Class)
return Gtk.Constraint_Target.Gtk_Constraint_Target
function "+"
(Widget : access Gtk_Editable_Label_Record'Class)
return Gtk.Editable.Gtk_Editable
function "-"
(Interf : Gtk.Accessible.Gtk_Accessible)
return Gtk_Editable_Label
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Editable_Label
function "-"
(Interf : Gtk.Constraint_Target.Gtk_Constraint_Target)
return Gtk_Editable_Label
function "-"
(Interf : Gtk.Editable.Gtk_Editable)
return Gtk_Editable_Label
procedure Announce
(Self : not null access Gtk_Editable_Label_Record;
Message : UTF8_String;
Priority : Gtk.Accessible.Gtk_Accessible_Announcement_Priority)
function Delegate_Get_Accessible_Platform_State
(Self : not null access Gtk_Editable_Label_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State) return Boolean
procedure Delete_Selection
(Self : not null access Gtk_Editable_Label_Record)
procedure Delete_Text
(Self : not null access Gtk_Editable_Label_Record;
Start_Pos : Glib.Gint;
End_Pos : Glib.Gint := -1)
Editing_Property : constant Glib.Properties.Property_Boolean;
This property is True while the widget is in edit mode.
procedure Finish_Delegate
(Self : not null access Gtk_Editable_Label_Record)
function Get_Accessible_Id
(Self : not null access Gtk_Editable_Label_Record) return UTF8_String
function Get_Accessible_Parent
(Self : not null access Gtk_Editable_Label_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Accessible_Role
(Self : not null access Gtk_Editable_Label_Record)
return Gtk.Accessible.Gtk_Accessible_Role
function Get_Alignment
(Self : not null access Gtk_Editable_Label_Record)
return Interfaces.C.C_float
function Get_At_Context
(Self : not null access Gtk_Editable_Label_Record)
return Gtk.Atcontext.Gtk_Atcontext
function Get_Bounds
(Self : not null access Gtk_Editable_Label_Record;
X : out Glib.Gint;
Y : out Glib.Gint;
Width : out Glib.Gint;
Height : out Glib.Gint) return Boolean
function Get_Chars
(Self : not null access Gtk_Editable_Label_Record;
Start_Pos : Glib.Gint;
End_Pos : Glib.Gint := -1) return UTF8_String
function Get_Delegate
(Self : not null access Gtk_Editable_Label_Record)
return Gtk.Editable.Gtk_Editable
function Get_Editable
(Self : not null access Gtk_Editable_Label_Record) return Boolean
function Get_Editing
(Self : not null access Gtk_Editable_Label_Record) return Boolean
Returns whether the label is currently in "editing mode".
True if Self is currently in editing mode
function Get_Enable_Undo
(Self : not null access Gtk_Editable_Label_Record) return Boolean
function Get_First_Accessible_Child
(Self : not null access Gtk_Editable_Label_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Max_Width_Chars
(Self : not null access Gtk_Editable_Label_Record) return Glib.Gint
function Get_Next_Accessible_Sibling
(Self : not null access Gtk_Editable_Label_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Platform_State
(Self : not null access Gtk_Editable_Label_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State) return Boolean
function Get_Position
(Self : not null access Gtk_Editable_Label_Record) return Glib.Gint
procedure Get_Selection_Bounds
(Self : not null access Gtk_Editable_Label_Record;
Start_Pos : out Glib.Gint;
End_Pos : out Glib.Gint;
Has_Selection : out Boolean)
function Get_Text
(Self : not null access Gtk_Editable_Label_Record) return UTF8_String
function Get_Type return Glib.GType
function Get_Width_Chars
(Self : not null access Gtk_Editable_Label_Record) return Glib.Gint
type Gtk_Editable_Label is access all Gtk_Editable_Label_Record'Class;
function Gtk_Editable_Label_New
(Str : UTF8_String) return Gtk_Editable_Label
Creates a new GtkEditableLabel widget.
the text for the label
type Gtk_Editable_Label_Record is new Gtk_Widget_Record with null record;
procedure Gtk_New (Self : out Gtk_Editable_Label; Str : UTF8_String)
Creates a new GtkEditableLabel widget. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
the text for the label
package Implements_Gtk_Accessible is new Glib.Types.Implements
(Gtk.Accessible.Gtk_Accessible, Gtk_Editable_Label_Record, Gtk_Editable_Label);
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Editable_Label_Record, Gtk_Editable_Label);
package Implements_Gtk_Constraint_Target is new Glib.Types.Implements
(Gtk.Constraint_Target.Gtk_Constraint_Target, Gtk_Editable_Label_Record, Gtk_Editable_Label);
package Implements_Gtk_Editable is new Glib.Types.Implements
(Gtk.Editable.Gtk_Editable, Gtk_Editable_Label_Record, Gtk_Editable_Label);
procedure Init_Delegate
(Self : not null access Gtk_Editable_Label_Record)
procedure Initialize
(Self : not null access Gtk_Editable_Label_Record'Class;
Str : UTF8_String)
Creates a new GtkEditableLabel widget. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
the text for the label
procedure Insert_Text
(Self : not null access Gtk_Editable_Label_Record;
Text : UTF8_String;
Length : Glib.Gint;
Position : in out Glib.Gint)
procedure Reset_Property
(Self : not null access Gtk_Editable_Label_Record;
Property : Gtk.Accessible.Gtk_Accessible_Property)
procedure Reset_Relation
(Self : not null access Gtk_Editable_Label_Record;
Relation : Gtk.Accessible.Gtk_Accessible_Relation)
procedure Reset_State
(Self : not null access Gtk_Editable_Label_Record;
State : Gtk.Accessible.Gtk_Accessible_State)
procedure Select_Region
(Self : not null access Gtk_Editable_Label_Record;
Start_Pos : Glib.Gint;
End_Pos : Glib.Gint := -1)
procedure Set_Accessible_Parent
(Self : not null access Gtk_Editable_Label_Record;
Parent : Gtk.Accessible.Gtk_Accessible;
Next_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Set_Alignment
(Self : not null access Gtk_Editable_Label_Record;
Xalign : Interfaces.C.C_float)
procedure Set_Editable
(Self : not null access Gtk_Editable_Label_Record;
Is_Editable : Boolean)
procedure Set_Enable_Undo
(Self : not null access Gtk_Editable_Label_Record;
Enable_Undo : Boolean)
procedure Set_Max_Width_Chars
(Self : not null access Gtk_Editable_Label_Record;
N_Chars : Glib.Gint)
procedure Set_Position
(Self : not null access Gtk_Editable_Label_Record;
Position : Glib.Gint)
procedure Set_Text
(Self : not null access Gtk_Editable_Label_Record;
Text : UTF8_String)
procedure Set_Width_Chars
(Self : not null access Gtk_Editable_Label_Record;
N_Chars : Glib.Gint)
procedure Start_Editing
(Self : not null access Gtk_Editable_Label_Record)
Switches the label into "editing mode".
procedure Stop_Editing
(Self : not null access Gtk_Editable_Label_Record;
Commit : Boolean)
Switches the label out of "editing mode". If Commit is True, the resulting text is kept as the [propertyGtk.Editable:text] property value, otherwise the resulting text is discarded and the label will keep its previous [propertyGtk.Editable:text] property value.
whether to set the edited text on the label
procedure Update_Next_Accessible_Sibling
(Self : not null access Gtk_Editable_Label_Record;
New_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Update_Platform_State
(Self : not null access Gtk_Editable_Label_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State)