type Gtk_Editable is new Glib.Types.GType_Interface;
type Cb_Gtk_Editable_Void is not null access procedure (Self : Gtk_Editable);
type Cb_GObject_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class);
type Cb_Gtk_Editable_Gint_Gint_Void is not null access procedure (Self : Gtk_Editable; Start_Pos : Gint; End_Pos : Gint);
type Cb_GObject_Gint_Gint_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class; Start_Pos : Gint; End_Pos : Gint);
type Cb_Gtk_Editable_UTF8_String_Gint_Gint_Void is not null access procedure (Self : Gtk_Editable; New_Text : UTF8_String; New_Text_Length : Gint; Position : access Gint);
type Cb_GObject_UTF8_String_Gint_Gint_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class; New_Text : UTF8_String; New_Text_Length : Gint; Position : access Gint);
Null_Gtk_Editable : constant Gtk_Editable;
Signal_Changed : constant Glib.Signal_Name := "changed";
Signal_Delete_Text : constant Glib.Signal_Name := "delete-text";
Signal_Insert_Text : constant Glib.Signal_Name := "insert-text";
function Get_Type return Glib.GType;
procedure Copy_Clipboard
( | Editable | : Gtk_Editable); |
procedure Cut_Clipboard
( | Editable | : Gtk_Editable); |
procedure Delete_Selection
( | Editable | : Gtk_Editable); |
procedure Delete_Text
( | Editable | : Gtk_Editable; |
Start_Pos | : Gint; | |
End_Pos | : Gint := -1); |
function Get_Chars
( | Editable | : Gtk_Editable; |
Start_Pos | : Gint; | |
End_Pos | : Gint := -1) return UTF8_String; |
function Get_Editable
( | Editable | : Gtk_Editable) return Boolean; |
procedure Set_Editable
( | Editable | : Gtk_Editable; |
Is_Editable | : Boolean); |
function Get_Position
( | Editable | : Gtk_Editable) return Gint; |
procedure Set_Position
( | Editable | : Gtk_Editable; |
Position | : Gint); |
procedure Get_Selection_Bounds
( | Editable | : Gtk_Editable; |
Start_Pos | : out Gint; | |
End_Pos | : out Gint; | |
Has_Selection | : out Boolean); |
procedure Insert_Text
( | Editable | : Gtk_Editable; |
New_Text | : UTF8_String; | |
New_Text_Length | : Gint; | |
Position | : in out Gint); |
procedure Paste_Clipboard
( | Editable | : Gtk_Editable); |
procedure Select_Region
( | Editable | : Gtk_Editable; |
Start_Pos | : Gint; | |
End_Pos | : Gint := -1); |
procedure Insert_Text
( | Editable | : Gtk_Editable; |
New_Text | : UTF8_String; | |
Position | : in out Gint); |
procedure On_Changed
( | Self | : Gtk_Editable; |
Call | : Cb_Gtk_Editable_Void; | |
After | : Boolean := False); |
procedure On_Changed
( | Self | : Gtk_Editable; |
Call | : Cb_GObject_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
procedure On_Delete_Text
( | Self | : Gtk_Editable; |
Call | : Cb_Gtk_Editable_Gint_Gint_Void; | |
After | : Boolean := False); |
procedure On_Delete_Text
( | Self | : Gtk_Editable; |
Call | : Cb_GObject_Gint_Gint_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
procedure On_Insert_Text
( | Self | : Gtk_Editable; |
Call | : Cb_Gtk_Editable_UTF8_String_Gint_Gint_Void; | |
After | : Boolean := False); |
procedure On_Insert_Text
( | Self | : Gtk_Editable; |
Call | : Cb_GObject_UTF8_String_Gint_Gint_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
function "+"
( | W | : Gtk_Editable) return Gtk_Editable; |
The Gtk.Editable.Gtk_Editable interface is an interface which should be implemented by text editing widgets, such as Gtk.GEntry.Gtk_Entry and Gtk.Spin_Button.Gtk_Spin_Button. It contains functions for generically manipulating an editable widget, a large number of action signals used for key bindings, and several signals that an application can connect to to modify the behavior of a widget.
As an example of the latter usage, by connecting the following handler to Gtk.Editable.Gtk_Editable::insert-text, an application can convert all entry into a widget into uppercase. == Forcing entry to uppercase. == include <ctype.h> void insert_text_handler (GtkEditable *editable, const gchar *text, gint length, gint *position, gpointer data) { gchar *result = g_utf8_strup (text, length); g_signal_handlers_block_by_func (editable, (gpointer) insert_text_handler, data); gtk_editable_insert_text (editable, result, length, position); g_signal_handlers_unblock_by_func (editable, (gpointer) insert_text_handler, data); g_signal_stop_emission_by_name (editable, "insert_text"); g_free (result); }