Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::Gtk::TextTag Class Reference

A GtkTextTag C++ wrapper class. More...

#include <inti/gtk/texttag.h>

Inheritance diagram for Inti::Gtk::TextTag:

Inti::G::Object Inti::G::TypeInstance Inti::MemoryHandler Inti::ReferencedBase List of all members.

Public Member Functions

Constructors
Accessors
Methods
Property Proxies
Signal Proxies

Protected Member Functions

Constructors
Signal Handlers

Detailed Description

A GtkTextTag C++ wrapper class.

Text in a buffer can be marked with tags. A tag is an attribute that can be applied to some range of text. For example, a tag might be called "bold" and make the text inside the tag bold. However, the tag concept is more general than that; tags don't have to affect appearance. They can instead affect the behavior of mouse and key presses, "lock" a range of text so the user can't edit it, or countless other things.

A tag is represented by a TextTag object. One TextTag can be applied to any number of text ranges in any number of buffers. Each tag is stored in a TextTagTable. A tag table defines a set of tags that can be used together. Each buffer has one tag table associated with it; only tags from that tag table can be used with the buffer. A single tag table can be shared between multiple buffers, however.

Tags can have names, which is convenient sometimes (for example, you can name your tag that makes things bold "bold"), but they can also be anonymous (which is convenient if you're creating tags on-the-fly).


Constructor & Destructor Documentation

Inti::Gtk::TextTag::TextTag GtkTextTag *  tag,
bool  reference = true
[explicit, protected]
 

Construct a new TextTag from an existing GtkTextTag.

Parameters:
tag A pointer to a GtkTextTag.
reference Set false if the initial reference count is floating, set true if it's not.

The tag can be a newly created GtkTextTag or an existing GtkTextTag (see G::Object::Object).

Inti::Gtk::TextTag::TextTag const char *  name = 0  ) 
 

Construct a new text tag.

Parameters:
name The name for this tag, or null for an anonymous tag.


Member Function Documentation

bool Inti::Gtk::TextTag::event G::Object event_object,
Gdk::Event event,
const TextIter iter
 

Emits the event signal on the TextTag.

Parameters:
event_object The object that received the event, such as a widget.
event The event.
iter The location where the event was received.
Returns:
The result of signal emission (whether the event was handled).

int Inti::Gtk::TextTag::get_priority  )  const
 

Gets the tag priority.

Returns:
The tag's priority.

bool Inti::Gtk::TextTag::on_event G::Object event_object,
Gdk::Event event,
const TextIter iter
[protected]
 

Called when the text tag receives a motion, button, or key event signal.

Parameters:
event_object The object that received the event, such as a widget.
event The event.
iter The location where the event was received.
Returns:
true if the event was handled, false if it wasn't handled.

const LanguagePropertyProxy Inti::Gtk::TextTag::prop_language  )  [inline]
 

The language this text is in, as an ISO code.

Pango can use this as a hint when rendering the text. If you don't understand this parameter, you probably don't need it (String : Read / Write).

const ScalePropertyProxy Inti::Gtk::TextTag::prop_scale  )  [inline]
 

The font size as a scale factor relative to the default font size.

This properly adapts to theme changes etc. so is recommended. Pango predefines some scales such as PANGO_SCALE_X_LARGE (double : Read / Write).

void Inti::Gtk::TextTag::set_priority int  priority  ) 
 

Sets the priority of the TextTag.

Parameters:
priority The new priority.

Valid priorities are start at 0 and go to one less than Gtk::TextTagTable::get_size(). Each tag in a table has a unique priority; setting the priority of one tag shifts the priorities of all the other tags in the table to maintain a unique priority for each tag. Higher priority tags "win" if two tags both set the same text attribute. When adding a tag to a tag table, it will be assigned the highest priority in the table by default; so normally the precedence of a set of tags is the order in which they were added to the table, or created with gtk_text_buffer_create_tag(), which adds the tag to the buffer's table automatically.

TextTagTable* Inti::Gtk::TextTag::table  )  const
 

Returns the tag table for the tag.

Returns:
The tag table.

Pointer<TextAttributes> Inti::Gtk::TextTag::values  )  const
 

Returns a smart pointer to the TextAttributes the tag uses for displaying text.

The information specified acts an override on information specified by lower-priority tags. If no value is specified, then the next-lower-priority tag on the text determines the value. The text widget itself provides defaults if no tag specifies an override.


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:20 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002