EntryBuffer
Object Hierarchy:
Description:
The EntryBuffer class contains the actual text displayed in a
Entry widget.
A single EntryBuffer object can be shared by multiple
Entry widgets which will then share the same text content, but not the cursor position,
visibility attributes, icon etc.
EntryBuffer 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.
Namespace: Gtk
Package: gtk+-2.0
Content:
Properties:
-
public uint length { get; }
The length (in characters) of the text in buffer.
-
public int max_length { set; get; }
The maximum length (in characters) of the text in the buffer.
-
public string text { set; get; }
The contents of the buffer.
Creation methods:
Methods:
-
public virtual uint delete_text (uint position, int n_chars)
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.
-
public void emit_deleted_text (uint position, uint n_chars)
-
public void emit_inserted_text (uint position, uint8[] chars)
-
public size_t get_bytes ()
Retrieves the length in bytes of the buffer. See
get_length.
-
public virtual uint get_length ()
Retrieves the length in characters of the buffer.
-
public int get_max_length ()
Retrieves the maximum allowed length of the text in buffer. See
set_max_length.
-
public virtual unowned string get_text ()
Retrieves the contents of the buffer.
-
public virtual uint insert_text (uint position, uint8[] chars)
Inserts n_chars characters of chars into the contents of the buffer, at
position position.
-
public void set_max_length (int max_length)
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.
-
public void set_text (uint8[] chars)
Sets the text in the buffer.
Signals: