W Wrapl, The Programming Language

Libraries:Gtk:Gtk:EntryBuffer

Types

T

Inherits from:

The T class contains the actual text displayed in a Gtk.Gtk.Entry.T widget.

A single T object can be shared by multiple Gtk.Gtk.Entry.T widgets which will then share the same text content, but not the cursor position, visibility attributes, icon etc.

T 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.



Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



New(initial_chars @ Std.String.T, n_initial_chars @ Std.Integer.SmallT) : Gtk.Gtk.EntryBuffer.T

Create a new GtkEntryBuffer object.

Optionally, specify initial text to set in the buffer.

initial_chars initial buffer text, or NULL. [allow-none]
n_initial_chars number of characters in initial_chars, or -1
Returns A new GtkEntryBuffer object.


Methods

:DeleteText(self @ T, position @ Std.Integer.SmallT, n_chars @ Std.Integer.SmallT) : Std.Integer.SmallT

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.

buffer a T
position position at which to delete text
n_chars number of characters to delete
Returns The number of characters deleted.


:EmitDeletedText(self @ T, position @ Std.Integer.SmallT, n_chars @ Std.Integer.SmallT) : Std.Object.T

Used when subclassing T

buffer a T
position position at which text was deleted
n_chars number of characters deleted


:EmitInsertedText(self @ T, position @ Std.Integer.SmallT, chars @ Std.String.T, n_chars @ Std.Integer.SmallT) : Std.Object.T

Used when subclassing T

buffer a T
position position at which text was inserted
chars text that was inserted
n_chars number of characters inserted


:GetBytes(self @ T) : Std.Integer.SmallT

Retrieves the length in bytes of the buffer. See GetLength.

buffer a T
Returns The byte length of the buffer.


:GetLength(self @ T) : Std.Integer.SmallT

Retrieves the length in characters of the buffer.

buffer a T
Returns The number of characters in the buffer.


:GetMaxLength(self @ T) : Std.Integer.SmallT

Retrieves the maximum allowed length of the text in buffer. See SetMaxLength.

buffer a T
Returns the maximum allowed number of characters in T, or 0 if there is no maximum.


:GetText(self @ T) : Std.String.T

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.

buffer a T
Returns 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.


:InsertText(self @ T, position @ Std.Integer.SmallT, chars @ Std.String.T, n_chars @ Std.Integer.SmallT) : Std.Integer.SmallT

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.

buffer a T
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
Returns The number of characters actually inserted.


:Priv(self @ T) : Std.Object.T

:SetMaxLength(self @ T, max_length @ Std.Integer.SmallT) : Std.Object.T

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.

buffer a T
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.


:SetText(self @ T, chars @ Std.String.T, n_chars @ Std.Integer.SmallT) : Std.Object.T

Sets the text in the buffer.

This is roughly equivalent to calling DeleteText and InsertText.

Note that n_chars is in characters, not in bytes.

buffer a T
chars the new text
n_chars the number of characters in text, or -1


:setPriv(self @ T, value @ Std.Object.T) : Std.Object.T