Class Index Cross Index Namespace Index

Class Gtk::Entry

A single line text entry field.
Contained in: Gtk
Derived from: Gtk::Editable
Derived by: Gtk::SpinButton

#include <gtk--/entry.h>


public function member index:

explicit Entry(guint max);
Entry();
void append_text(const string& text);
string get_text() const;
unsigned int get_text_length() const;
GtkEntry* gtkobj();
const GtkEntry* gtkobj() const;
static bool isA(Object* object);
void prepend_text(const string& text);
void select_region(gint start, gint end);
void set_max_length(guint16 max);
void set_position(gint position);
void set_text(const string& text);
void set_visibility(bool visible);
virtual ~Entry();
 

Description:

The GtkEntry widget is a single line text entry widget. A fairly large set of key bindings are supported by default. If the entered text is longer than the allocation of the widget, the widget will scroll so that the cursor position is visible.


Function Member Descriptions:

Gtk::Entry::Entry - Creates a new Gtk::Entry widget with the given maximum length.

explicit Entry(guint max);
max: The new maximum length.


Gtk::Entry::append_text - Appends the given text to the contents of the widget.

void append_text(const string& text);
text: The text to append.


Gtk::Entry::get_text - Retrieve the contents of the entry widget.

string get_text() const;
Returns: The contents of the text widget as a string.


Gtk::Entry::gtkobj - Returns the underlaying gtk+ object.

GtkEntry* gtkobj();

Gtk::Entry::isA - Returns true if object is this type.

static bool isA(Object* object);

Gtk::Entry::prepend_text - Prepends the given text to the contents of the widget.

void prepend_text(const string& text);
text: The text to prepend.


Gtk::Entry::select_region - Selects a region of text.

void select_region(gint start, gint end);
The characters that are selected are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the characters selected will be those characters from start_pos to the end of the text.

start: The starting position.

end: The end position.



Gtk::Entry::set_max_length - Sets the maximum allowed length of the contents of the widget.

void set_max_length(guint16 max);
If the current contents are longer than the given length, then they will be truncated to fit.

max: The new maximum length.



Gtk::Entry::set_position - Sets the cursor position in an entry to the given value.

void set_position(gint position);
position: The position of the cursor. The cursor is displayed before the character with the given (base 0) index in the widget. The value must be less than or equal to the number of characters in the widget. A value of -1 indicates that the position should be set after the last character in the entry. Note that this position is in characters, not in bytes.


Gtk::Entry::set_text - Sets the text in the widget to the given value, replacing the current contents.

void set_text(const string& text);
text: The new text.


Gtk::Entry::set_visibility - Sets whether the contents of the entry are visible or not.

void set_visibility(bool visible);
When visibility is set to FALSE, characters are displayed as asterisks (*'s), and will also appear that way when the text in the entry widget is copied elsewhere.

visible: TRUE if the contents of the entry are displayed as plaintext.