The Gtk.Entry_Buffer.Gtk_Entry_Buffer class contains the actual text displayed in a Gtk.GEntry.Gtk_Entry widget.
A single Gtk.Entry_Buffer.Gtk_Entry_Buffer object can be shared by multiple Gtk.GEntry.Gtk_Entry widgets which will then share the same text content, but not the cursor position, visibility attributes, icon etc.
Gtk.Entry_Buffer.Gtk_Entry_Buffer may be derived from. Such a derived class might allow text to be stored in an alternate location, such as non-pageable memory, useful in the case of important passwords. Or a derived class could integrate with an application's concept of undo/redo.
type Cb_GObject_Guint_Guint_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class;
Position : Guint;
N_Chars : Guint);
type Cb_GObject_Guint_UTF8_String_Guint_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class;
Position : Guint;
Chars : UTF8_String;
N_Chars : Guint);
type Cb_Gtk_Entry_Buffer_Guint_Guint_Void is not null access procedure
(Self : access Gtk_Entry_Buffer_Record'Class;
Position : Guint;
N_Chars : Guint);
type Cb_Gtk_Entry_Buffer_Guint_UTF8_String_Guint_Void is not null access procedure
(Self : access Gtk_Entry_Buffer_Record'Class;
Position : Guint;
Chars : UTF8_String;
N_Chars : Guint);
function Delete_Text
(Self : not null access Gtk_Entry_Buffer_Record;
Position : Guint;
N_Chars : Glib.Gint) return Guint
Deletes a sequence of characters from the buffer. N_Chars characters are deleted starting at Position. If N_Chars is negative, then all characters until the end of the text are deleted. If Position or N_Chars are out of bounds, then they are coerced to sane values. Note that the positions are specified in characters, not bytes. Since: gtk+ 2.18
position at which to delete text
number of characters to delete
The number of characters deleted.
procedure Emit_Deleted_Text
(Self : not null access Gtk_Entry_Buffer_Record;
Position : Guint;
N_Chars : Guint)
Used when subclassing Gtk.Entry_Buffer.Gtk_Entry_Buffer Since: gtk+ 2.18
position at which text was deleted
number of characters deleted
procedure Emit_Inserted_Text
(Self : not null access Gtk_Entry_Buffer_Record;
Position : Guint;
Chars : UTF8_String;
N_Chars : Guint)
Used when subclassing Gtk.Entry_Buffer.Gtk_Entry_Buffer Since: gtk+ 2.18
position at which text was inserted
text that was inserted
number of characters inserted
function Get_Bytes
(Self : not null access Gtk_Entry_Buffer_Record) return Gsize
Retrieves the length in bytes of the buffer. See Gtk.Entry_Buffer.Get_Length. Since: gtk+ 2.18
The byte length of the buffer.
function Get_Length
(Self : not null access Gtk_Entry_Buffer_Record) return Guint
Retrieves the length in characters of the buffer. Since: gtk+ 2.18
The number of characters in the buffer.
function Get_Max_Length
(Self : not null access Gtk_Entry_Buffer_Record) return Glib.Gint
Retrieves the maximum allowed length of the text in Buffer. See Gtk.Entry_Buffer.Set_Max_Length. Since: gtk+ 2.18
the maximum allowed number of characters in Gtk.Entry_Buffer.Gtk_Entry_Buffer, or 0 if there is no maximum.
function Get_Text
(Self : not null access Gtk_Entry_Buffer_Record) return UTF8_String
Retrieves the contents of the buffer. The memory pointer returned by this call will not change unless this object emits a signal, or is finalized. Since: gtk+ 2.18
a pointer to the contents of the widget as a string. This string points to internally allocated storage in the buffer and must not be freed, modified or stored.
function Get_Type return Glib.GType
type Gtk_Entry_Buffer is access all Gtk_Entry_Buffer_Record'Class;
function Gtk_Entry_Buffer_New
(Initial_Chars : UTF8_String := "";
N_Initial_Chars : Glib.Gint) return Gtk_Entry_Buffer
Create a new GtkEntryBuffer object. Optionally, specify initial text to set in the buffer. Since: gtk+ 2.18
initial buffer text, or null
number of characters in Initial_Chars, or -1
type Gtk_Entry_Buffer_Record is new GObject_Record with null record;
procedure Gtk_New
(Self : out Gtk_Entry_Buffer;
Initial_Chars : UTF8_String := "";
N_Initial_Chars : Glib.Gint)
Create a new GtkEntryBuffer object. Optionally, specify initial text to set in the buffer. Since: gtk+ 2.18 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
initial buffer text, or null
number of characters in Initial_Chars, or -1
procedure Initialize
(Self : not null access Gtk_Entry_Buffer_Record'Class;
Initial_Chars : UTF8_String := "";
N_Initial_Chars : Glib.Gint)
Create a new GtkEntryBuffer object. Optionally, specify initial text to set in the buffer. Since: gtk+ 2.18 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
initial buffer text, or null
number of characters in Initial_Chars, or -1
function Insert_Text
(Self : not null access Gtk_Entry_Buffer_Record;
Position : Guint;
Chars : UTF8_String;
N_Chars : Glib.Gint) return Guint
Inserts N_Chars characters of Chars into the contents of the buffer, at position Position. If N_Chars is negative, then characters from chars will be inserted until a null-terminator is found. If Position or N_Chars are out of bounds, or the maximum buffer text length is exceeded, then they are coerced to sane values. Note that the position and length are in characters, not in bytes. Since: gtk+ 2.18
the position at which to insert text.
the text to insert into the buffer.
the length of the text in characters, or -1
The number of characters actually inserted.
Length_Property : constant Glib.Properties.Property_Uint;
The length (in characters) of the text in buffer.
Max_Length_Property : constant Glib.Properties.Property_Int;
The maximum length (in characters) of the text in the buffer.
procedure On_Deleted_Text
(Self : not null access Gtk_Entry_Buffer_Record;
Call : Cb_GObject_Guint_Guint_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
This signal is emitted after text is deleted from the buffer.
Callback parameters: -- @param Position the position the text was deleted at. -- @param N_Chars The number of characters that were deleted.
procedure On_Deleted_Text
(Self : not null access Gtk_Entry_Buffer_Record;
Call : Cb_Gtk_Entry_Buffer_Guint_Guint_Void;
After : Boolean := False)
This signal is emitted after text is deleted from the buffer.
Callback parameters: -- @param Position the position the text was deleted at. -- @param N_Chars The number of characters that were deleted.
procedure On_Inserted_Text
(Self : not null access Gtk_Entry_Buffer_Record;
Call : Cb_GObject_Guint_UTF8_String_Guint_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
This signal is emitted after text is inserted into the buffer.
Callback parameters: -- @param Position the position the text was inserted at. -- @param Chars The text that was inserted. -- @param N_Chars The number of characters that were inserted.
procedure On_Inserted_Text
(Self : not null access Gtk_Entry_Buffer_Record;
Call : Cb_Gtk_Entry_Buffer_Guint_UTF8_String_Guint_Void;
After : Boolean := False)
This signal is emitted after text is inserted into the buffer.
Callback parameters: -- @param Position the position the text was inserted at. -- @param Chars The text that was inserted. -- @param N_Chars The number of characters that were inserted.
procedure Set_Max_Length
(Self : not null access Gtk_Entry_Buffer_Record;
Max_Length : Glib.Gint)
Sets the maximum allowed length of the contents of the buffer. If the current contents are longer than the given length, then they will be truncated to fit. Since: gtk+ 2.18
the maximum length of the entry buffer, or 0 for no maximum. (other than the maximum length of entries.) The value passed in will be clamped to the range 0-65536.
procedure Set_Text
(Self : not null access Gtk_Entry_Buffer_Record;
Chars : UTF8_String;
N_Chars : Glib.Gint)
Sets the text in the buffer. This is roughly equivalent to calling Gtk.Entry_Buffer.Delete_Text and Gtk.Entry_Buffer.Insert_Text. Note that N_Chars is in characters, not in bytes. Since: gtk+ 2.18
the new text
the number of characters in Text, or -1
Signal_Deleted_Text : constant Glib.Signal_Name := "deleted-text";
This signal is emitted after text is deleted from the buffer.
Callback parameters: -- @param Position the position the text was deleted at. -- @param N_Chars The number of characters that were deleted.
Signal_Inserted_Text : constant Glib.Signal_Name := "inserted-text";
This signal is emitted after text is inserted into the buffer.
Callback parameters: -- @param Position the position the text was inserted at. -- @param Chars The text that was inserted. -- @param N_Chars The number of characters that were inserted.
Text_Property : constant Glib.Properties.Property_String;
The contents of the buffer.