Gtk.Entry_Buffer

Entities

Tagged Types

Access Types

Constants

Subprograms

Description

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.

Cb_GObject_Guint_Guint_Void

type Cb_GObject_Guint_Guint_Void is not null access procedure
  (Self     : access Glib.Object.GObject_Record'Class;
   Position : Guint;
   N_Chars  : Guint);
Parameters
Self
Position
N_Chars

Cb_GObject_Guint_UTF8_String_Guint_Void

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);
Parameters
Self
Position
Chars
N_Chars

Cb_Gtk_Entry_Buffer_Guint_Guint_Void

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);
Parameters
Self
Position
N_Chars

Cb_Gtk_Entry_Buffer_Guint_UTF8_String_Guint_Void

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);
Parameters
Self
Position
Chars
N_Chars

Delete_Text

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

Parameters
Self
Position

position at which to delete text

N_Chars

number of characters to delete

Return Value

The number of characters deleted.

Emit_Deleted_Text

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

Parameters
Self
Position

position at which text was deleted

N_Chars

number of characters deleted

Emit_Inserted_Text

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

Parameters
Self
Position

position at which text was inserted

Chars

text that was inserted

N_Chars

number of characters inserted

Get_Bytes

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

Parameters
Self
Return Value

The byte length of the buffer.

Get_Length

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

Parameters
Self
Return Value

The number of characters in the buffer.

Get_Max_Length

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

Parameters
Self
Return Value

the maximum allowed number of characters in Gtk.Entry_Buffer.Gtk_Entry_Buffer, or 0 if there is no maximum.

Get_Text

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

Parameters
Self
Return Value

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.

Get_Type

function Get_Type return Glib.GType
Return Value

Gtk_Entry_Buffer

type Gtk_Entry_Buffer is access all Gtk_Entry_Buffer_Record'Class;

Gtk_Entry_Buffer_New

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

Parameters
Initial_Chars

initial buffer text, or null

N_Initial_Chars

number of characters in Initial_Chars, or -1

Return Value

Gtk_Entry_Buffer_Record

type Gtk_Entry_Buffer_Record is new GObject_Record with null record;

Gtk_New

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.

Parameters
Self
Initial_Chars

initial buffer text, or null

N_Initial_Chars

number of characters in Initial_Chars, or -1

Initialize

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.

Parameters
Self
Initial_Chars

initial buffer text, or null

N_Initial_Chars

number of characters in Initial_Chars, or -1

Insert_Text

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

Parameters
Self
Position

the position at which to insert text.

Chars

the text to insert into the buffer.

N_Chars

the length of the text in characters, or -1

Return Value

The number of characters actually inserted.

Length_Property

Length_Property : constant Glib.Properties.Property_Uint;

The length (in characters) of the text in buffer.

Max_Length_Property

Max_Length_Property : constant Glib.Properties.Property_Int;

The maximum length (in characters) of the text in the buffer.

On_Deleted_Text

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.

Parameters
Self
Call
Slot
After

On_Deleted_Text

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.

Parameters
Self
Call
After

On_Inserted_Text

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.

Parameters
Self
Call
Slot
After

On_Inserted_Text

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.

Parameters
Self
Call
After

Set_Max_Length

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

Parameters
Self
Max_Length

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.

Set_Text

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

Parameters
Self
Chars

the new text

N_Chars

the number of characters in Text, or -1

Signal_Deleted_Text

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

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

Text_Property : constant Glib.Properties.Property_String;

The contents of the buffer.