Class Index Cross Index Namespace Index

Class Gtk::Text

Text widget which allows display and manipulation of arbitrary text.
Contained in: Gtk
Derived from: Gtk::Editable
Derived by: none

#include <gtk--/text.h>


public function member index:

Text(Adjustment& hadj, Adjustment& vadj);
Text();
gint backward_delete(guint nchars);
gint forward_delete(guint nchars);
void freeze();
Context get_context() const;
Adjustment* get_hadjustment() const;
guint get_length() const;
guint get_point() const;
Adjustment* get_vadjustment() const;
GtkText* gtkobj();
const GtkText* gtkobj() const;
void insert(const Gdk_Font& font, const Gdk_Color& fore, const Gdk_Color& back, const nstring& chars, gint length);
void insert(const Context& gc, const string& text);
void insert(const string& text);
static bool isA(Object* object);
void set_adjustments(Adjustment* hadj=0, Adjustment* vadj=0);
void set_adjustments(Adjustment& hadj, Adjustment& vadj);
void set_context();
void set_context(const Context& gc);
void set_line_wrap(bool line_wrap);
void set_point(guint index);
emitable signal void set_scroll_adjustments(Adjustment*, Adjustment*);
void set_word_wrap(bool word_wrap);
void thaw();
virtual ~Text();
 

protected function member index:

virtual void set_scroll_adjustments_impl(Adjustment* p0, Adjustment* p1);
 

Description:

A Gtk::Text widget allows one to display any given text and manipulate it by deleting from one point to another, selecting a region, and various other functions as outlined below. It is inherited from Gtk::Editable.


Function Member Descriptions:

Gtk::Text::backward_delete - Deletes from the current point position backward the given number of characters.

gint backward_delete(guint nchars);
nchars: The number of characters to delete.

Returns: TRUE if the operation was successful, otherwise returns FALSE.



Gtk::Text::forward_delete - Deletes from the current point position forward the given number of characters.

gint forward_delete(guint nchars);
nchars: The number of characters to delete.

Returns: TRUE if the operation was successful, otherwise returns FALSE.



Gtk::Text::freeze - Freezes the Gtk::Text widget which disallows redrawing of the widget until it is thawed.

void freeze();
This is useful if a large number of changes are going to made to the text within the widget, reducing the amount of flicker seen by the user.


Gtk::Text::get_length - Returns the length of the all the text contained within the Gtk::Text widget; disregards current point position.

guint get_length() const;
Returns: The length of the text.


Gtk::Text::get_point - Gets the current position of the cursor as the number of characters from the upper left corner of the Gtk::Text widget.

guint get_point() const;
Returns: The number of characters from the upper left corner.


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

GtkText* gtkobj();

Gtk::Text::insert - Inserts given text into the GtkText widget with the given properties as outlined below.

void insert(const Gdk_Font& font, const Gdk_Color& fore, const Gdk_Color& back, const nstring& chars, gint length);
font: The Gdk::Font to use.

fore: The foreground color to insert with.

back: The background color to insert with.

chars: The actual text to be inserted.

length: The length of the text to be inserted, passing -1 makes it insert all the text.



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

static bool isA(Object* object);

Gtk::Text::set_adjustments - Allows you to set GtkAdjustment pointers which in turn allows you to keep track of the viewing position of the Gtk::Text widget.

void set_adjustments(Adjustment* hadj=0, Adjustment* vadj=0);
hadj: The horizontal adjustment.

vadj: The vertical adjustment.



Gtk::Text::set_adjustments - Allows you to set GtkAdjustment pointers which in turn allows you to keep track of the viewing position of the Gtk::Text widget.

void set_adjustments(Adjustment& hadj, Adjustment& vadj);
hadj: The horizontal adjustment.

vadj: The vertical adjustment.



Gtk::Text::set_line_wrap - Controls how Gtk::Text handles long lines of continuous text.

void set_line_wrap(bool line_wrap);
If line wrap is on, the line is broken when it reaches the extent of the Gtk::Text widget viewing area and the rest is displayed on the next line. If it is not set, the line continues regardless size of current viewing area. Similar to word wrap but it disregards word boundaries.

line_wrap: TRUE turns line wrap on, FALSE turns it off.



Gtk::Text::set_point - Sets the cursor at the given point.

void set_point(guint index);
In this case a point constitutes the number of characters from the extreme upper left corner of the Gtk::Text widget. index: The number of characters from the upper left corner.


Gtk::Text::set_word_wrap - Sets whether the Gtk::Text widget wraps words down to the next line if it can't be completed on the current line.

void set_word_wrap(bool word_wrap);
word_wrap: TRUE makes it word wrap, FALSE disables word wrapping.


Gtk::Text::thaw - Allows the Gtk::Text widget to be redrawn again by GTK.

void thaw();


Variable Member Descriptions: