Index

Package: Entry_Buffer

Description

package Gtk.Entry_Buffer is

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.

Classes

Gtk_Entry_Buffer_Record

type Gtk_Entry_Buffer_Record is new GObject_Record with null record;

Ancestors:

Primitive operations:

Emit_Deleted_Text
Emit_Inserted_Text
Get_Max_Length
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)
On_Deleted_Text
On_Deleted_Text
On_Inserted_Text
On_Inserted_Text
Set_Max_Length

Types

Gtk_Entry_Buffer

type Gtk_Entry_Buffer is access all Gtk_Entry_Buffer_Record'Class;

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);

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);

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);

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);

Constants & Global variables

Length_Property (Glib.Properties.Property_Uint)

Length_Property : constant Glib.Properties.Property_Uint;
The length (in characters) of the text in buffer.

Max_Length_Property (Glib.Properties.Property_Int)

Max_Length_Property : constant Glib.Properties.Property_Int;
The maximum length (in characters) of the text in the buffer.

Text_Property (Glib.Properties.Property_String)

Text_Property : constant Glib.Properties.Property_String;
The contents of the buffer.

Signal_Deleted_Text (Glib.Signal_Name)

Signal_Deleted_Text : constant Glib.Signal_Name := "deleted-text";

Signal_Inserted_Text (Glib.Signal_Name)

Signal_Inserted_Text : constant Glib.Signal_Name := "inserted-text";

Subprograms & Entries

Gtk_New

procedure Gtk_New 
(Self: out Gtk_Entry_Buffer;
Initial_Chars: UTF8_String := "";
N_Initial_Chars: Gint);

Initialize

procedure Initialize 
(Self: not null access Gtk_Entry_Buffer_Record'Class;
Initial_Chars: UTF8_String := "";
N_Initial_Chars: Gint);
Create a new GtkEntryBuffer object. Optionally, specify initial text to set in the buffer. Since: gtk+ 2.18 "initial_chars": initial buffer text, or null "n_initial_chars": number of characters in Initial_Chars, or -1

Gtk_Entry_Buffer_New

function Gtk_Entry_Buffer_New 
(Initial_Chars: UTF8_String := "";
N_Initial_Chars: Gint) return Gtk_Entry_Buffer;
Create a new GtkEntryBuffer object. Optionally, specify initial text to set in the buffer. Since: gtk+ 2.18 "initial_chars": initial buffer text, or null "n_initial_chars": number of characters in Initial_Chars, or -1

Get_Type

function Get_Type return Glib.GType;

Delete_Text

function Delete_Text 
(Self: not null access Gtk_Entry_Buffer_Record;
Position: Guint;
N_Chars: 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": position at which to delete text "n_chars": number of characters to delete

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 "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 "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

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

Get_Max_Length

function Get_Max_Length 
(Self: not null access Gtk_Entry_Buffer_Record) return Gint;
Retrieves the maximum allowed length of the text in Buffer. See Gtk.Entry_Buffer.Set_Max_Length. Since: gtk+ 2.18

Set_Max_Length

procedure Set_Max_Length 
(Self: not null access Gtk_Entry_Buffer_Record;
Max_Length: 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 "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.

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

Set_Text

procedure Set_Text 
(Self: not null access Gtk_Entry_Buffer_Record;
Chars: UTF8_String;
N_Chars: 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 "chars": the new text "n_chars": the number of characters in Text, or -1

Insert_Text

function Insert_Text 
(Self: not null access Gtk_Entry_Buffer_Record;
Position: Guint;
Chars: UTF8_String;
N_Chars: 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 "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

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);

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: -- "position": the position the text was deleted at. -- "n_chars": The number of characters that were deleted.

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);

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: -- "position": the position the text was inserted at. -- "chars": The text that was inserted. -- "n_chars": The number of characters that were inserted.