Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::TextView Class Reference

A GtkTextView C++ wrapper class. More...

`#include <inti/gtk/textview.h>`

Inheritance diagram for Inti::Gtk::TextView:

List of all members.

## Public Member Functions

Constructors

- TextView ()
    Constructs a new text view widget.
- TextView (TextBuffer &buffer)
    Constructs a new text view widget displaying the buffer buffer.
- virtual ~TextView ()
    Destructor.

Accessors

- GtkTextView * gtk_text_view () const
    Get a pointer to the GtkTextView structure.
- GtkTextViewClass * gtk_text_view_class () const
    Get a pointer to the GtkTextViewClass structure.
- operator GtkTextView * () const
    Conversion operator; safely converts a TextView to a GtkTextView pointer.
- TextBuffer * get_buffer () const
    Returns the TextBuffer being displayed by this text view.
- void get_visible_rect (Gdk::Rectangle &visible_rect)
    Fills visible_rect with the currently visible region of the buffer, in buffer coordinates.
- Gdk::Rectangle get_visible_rect () const
    Returns a rectangle filled with the currently visible region of the buffer, in buffer coordinates.
- bool get_cursor_visible () const
    Find out whether the cursor is being displayed.
- void get_iter_location (const TextIter &iter, Gdk::Rectangle &location)
    Gets a rectangle which roughly contains the character at iter.
- Gdk::Rectangle get_iter_location (const TextIter &iter) const
    Returns a rectangle which roughly contains the character at iter.
- TextIter get_iter_at_location (int x, int y) const
    Retrieves the iterator at buffer coordinates x and y.
- void get_line_yrange (const TextIter &iter, int *y, int *height) const
    Gets the y coordinate of the top of the line containing iter, and the height of the line.
- int get_line_y (const TextIter &iter) const
    Gets the y coordinate of the top of the line containing iter.
- int get_line_height (const TextIter &iter) const
    Gets the height of the line containing iter.
- void get_line_at_y (TextIter &target_iter, int y, int *line_top) const
    Gets the TextIter at the start of the line containing the coordinate y.
- TextIter get_line_at_y (int y) const
    Returns the TextIter at the start of the line containing the coordinate y.
- Gdk::Window * get_window (TextWindowType window_type) const
    Retrieves the Gdk::Window corresponding to an area of the text view; possible windows include the overall widget window, child windows on the left, right, top, bottom, and the window that displays the text buffer.
- TextWindowType get_window_type (const Gdk::Window &window) const
    Usually used to find out which window an event corresponds to.
- int get_border_window_size (TextWindowType type) const
    Gets the width of the specified border window (see set_border_window_size()).
- WrapMode get_wrap_mode () const
    Gets the line wrapping for the view.
- bool get_editable () const
    Returns the default editability of the TextView.
- int get_pixels_above_lines () const
    Returns the default number of pixels to put above paragraphs.
- int get_pixels_below_lines () const
    Returns the default number of blank pixels below paragraphs.
- int get_pixels_inside_wrap () const
    Returns the default number of pixels of blank space between wrapped lines.
- Justification get_justification () const
    Returns the default justification of paragraphs in the text view.
- int get_left_margin () const
    Returns the default left margin size of paragraphs in the text_view.
- int get_right_margin () const
    Returns the default right margin for text in the text view.
- int get_indent () const
    Gets the default indentation of paragraphs in the text view.
- Pointer< Pango::TabArray > get_tabs () const
    Gets the default tabs for the text view.
- Pointer< TextAttributes > get_default_attributes () const
    Obtains a copy of the default text attributes.

Methods

- void set_buffer (TextBuffer *buffer)
    Sets buffer as the buffer being displayed by text_view.
- bool scroll_to_iter (const TextIter &iter, double within_margin, bool use_align, double xalign, double yalign)
    Scrolls the text view so that iter is on the screen in the position indicated by xalign and yalign.
- void scroll_to_mark (const TextMark &mark, double within_margin, bool use_align, double xalign, double yalign)
    Scrolls the text view so that mark is on the screen in the position indicated by xalign and yalign.
- void scroll_mark_onscreen (const TextMark &mark)
    Scrolls the text view the minimum distance such that mark is contained within the visible area of the widget.
- bool move_mark_onscreen (const TextMark &mark)
    Moves a mark within the buffer so that it's located within the currently-visible text area.
- bool place_cursor_onscreen ()
    Moves the cursor to the currently visible region of the buffer, it it isn't there already.
- void set_cursor_visible (bool setting)
    Toggles whether the insertion point is displayed.
- void buffer_to_window_coords (TextWindowType window_type, int buffer_x, int buffer_y, int *window_x, int *window_y)
    Converts coordinate (buffer_x, buffer_y) to coordinates for the window window_type, and stores the result in (window_x, window_y).
- void window_to_buffer_coords (TextWindowType window_type, int window_x, int window_y, int *buffer_x, int *buffer_y)
    Converts coordinates on the window identified by window_type to buffer coordinates, storing the result in (buffer_x,buffer_y).
- void set_border_window_size (TextWindowType window_type, int size)
    Sets the width of TEXT_WINDOW_LEFT or TEXT_WINDOW_RIGHT, or the height of TEXT_WINDOW_TOP or TEXT_WINDOW_BOTTOM.
- bool forward_display_line (TextIter &iter)
    Moves the given iter forward by one display (wrapped) line.
- bool backward_display_line (TextIter &iter)
    Moves the given iter backward by one display (wrapped) line.
- bool forward_display_line_end (TextIter &iter)
    Moves the given iter forward to the next display line end.
- bool backward_display_line_start (TextIter &iter)
    Moves the given iter backward to the next display line start.
- bool starts_display_line (const TextIter &iter)
    Determines whether iter is at the start of a display line (see forward_display_line() for an explanation of display lines vs.
- bool move_visually (TextIter &iter, int count)
    Moves iter up or down by count display (wrapped) lines (see forward_display_line() for an explanation of display lines vs.
- void add_child_at_anchor (Widget &child, TextChildAnchor &anchor)
    Adds a child widget in the text buffer, at the given anchor.
- void add_child_in_window (Widget &child, TextWindowType which_window, int xpos, int ypos)
    Adds a child at fixed coordinates in one of the text widget's windows.
- void move_child (const Widget &child, int xpos, int ypos)
    Updates the position of a child, as for add_child_in_window().
- void set_wrap_mode (WrapMode wrap_mode)
    Sets the line wrapping for the view.
- void set_editable (bool setting)
    Sets the default editability of the TextView.
- void set_pixels_above_lines (int pixels_above_lines)
    Sets the default number of blank pixels above paragraphs in text_view.
- void set_pixels_below_lines (int pixels_below_lines)
    Sets the default number of pixels of blank space to put below paragraphs.
- void set_pixels_inside_wrap (int pixels_inside_wrap)
    Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.
- void set_justification (Justification justification)
    Sets the default justification of text in the text view.
- void set_left_margin (int left_margin)
    Sets the default left margin for text in text_view.
- void set_right_margin (int right_margin)
    Sets the default right margin for text in the text view.
- void set_indent (int indent)
    Sets the default indentation for paragraphs in the text view.
- void set_tabs (const Pango::TabArray &tabs)
    Sets the default tab stops for paragraphs in the text view.

Property Proxies

- const PixelsAboveLinesPropertyProxy prop_pixels_above_lines ()
    The pixels of blank space above paragraphs (int : Read / Write).
- const PixelsBelowLinesPropertyProxy prop_pixels_below_lines ()
    The pixels of blank space below paragraphs (int : Read / Write).
- const PixelsInsideWrapPropertyProxy prop_pixels_inside_wrap ()
    The pixels of blank space between wrapped lines in a paragraph (int : Read / Write).
- const EditablePropertyProxy prop_editable ()
    Whether the text can be modified by the user (bool : Read / Write).
- const WrapModePropertyProxy prop_wrap_mode ()
    Whether to wrap lines never, at word boundaries, or at character boundaries (WrapMode : Read / Write).
- const JustificationPropertyProxy prop_justification ()
    Left, right, or center justification (Justification : Read / Write).
- const LeftMarginPropertyProxy prop_left_margin ()
    The width of the left margin in pixels (int : Read / Write).
- const RightMarginPropertyProxy prop_right_margin ()
    The width of the right margin in pixels (int : Read / Write).
- const IndentPropertyProxy prop_indent ()
    The amount to indent the paragraph, in pixels (int : Read / Write).
- const TabsPropertyProxy prop_tabs ()
    The custom tabs for the text.
- const CursorVisiblePropertyProxy prop_cursor_visible ()
    If the insertion cursor is shown (bool : Read / Write).

Signal Proxies

- const SetScrollAdjustmentsSignalProxy sig_set_scroll_adjustments ()
    Connect to the set_scroll_adjustments_signal; emitted when a text view is added to a scrolling aware parent.
- const PopulatePopupSignalProxy sig_populate_popup ()
    Connect to the populate_popup_signal; emitted when the text view displays its context-sensitive menu.
- const SetAnchorSignalProxy sig_set_anchor ()
    Connect to the set_anchor_signal; emitted when the "anchor" is moved (what Emacs calls the mark) to the cursor position.
- const InsertAtCursorSignalProxy sig_insert_at_cursor ()
    Connect to the insert_at_cursor_signal; emited when text is inserted into the buffer at the current cursor position.

## Protected Member Functions

Constructors

- TextView (GtkTextView *text_view, bool reference=false)
    Construct a new TextView from an existing GtkTextView.

Signal Handlers

- virtual void on_set_scroll_adjustments (Adjustment *hadjustment, Adjustment *vadjustment)
    Called when a text view is added to a scrolling aware parent.
- virtual void on_populate_popup (Menu &menu)
    Called when the text view displays its context-sensitive menu.
- virtual void on_set_anchor ()
    Called when the "anchor" is moved (what Emacs calls the mark) to the cursor position.
- virtual void on_insert_at_cursor (const String &str)
    Called when text is inserted into the buffer at the current cursor position.

## Detailed Description

A GtkTextView C++ wrapper class.

TextView is a widget which can display a TextBuffer. Each text buffer can be displayed by any number of views.

To use TextView in your application you only need to include the header file <textview.h>. This header file includes <textbuffer.h> which includes all the other header files that TextView needs.

## Constructor & Destructor Documentation

Inti::Gtk::TextView::TextView | ( | GtkTextView * | text_view,
|  | bool | reference = false
| ) | `[explicit, protected]`

  | Construct a new TextView from an existing GtkTextView. Parameters:
  text_view | A pointer to a GtkTextView.
  reference | Set false if the initial reference count is floating, set true if it's not.
The text_view can be a newly created GtkTextView or an existing GtkTextView (see G::Object::Object).

Inti::Gtk::TextView::TextView | ( |  | ) |

| Constructs a new text view widget. If you don't call set_buffer() before using the text view, an empty default buffer will be created for you. The buffer can be retrieved with get_buffer().

Inti::Gtk::TextView::TextView | ( | TextBuffer & | buffer | ) | `[explicit]`

  | Constructs a new text view widget displaying the buffer buffer. Parameters:
  buffer | A TextBuffer.
One buffer can be shared among many widgets. The text view adds its own reference count to the buffer; it does not take over an existing reference.

## Member Function Documentation

void Inti::Gtk::TextView::add_child_at_anchor | ( | Widget & | child,
|  | TextChildAnchor & | anchor
| ) |

  | Adds a child widget in the text buffer, at the given anchor. Parameters:
  child | A Widget.
  anchor | A TextChildAnchor in the TextBuffer for text_view.

void Inti::Gtk::TextView::add_child_in_window | ( | Widget & | child,
|  | TextWindowType | which_window,
|  | int | xpos,
|  | int | ypos
| ) |

  | Adds a child at fixed coordinates in one of the text widget's windows. Parameters:
  child | A Widget.
  which_window | Which window the child should appear in.
  xpos | The X position of child in window coordinates.
  ypos | the Y position of child in window coordinates.
The window must have nonzero size (see set_border_window_size()). Note that the child coordinates are given relative to the Gdk::Window in question, and that these coordinates have no sane relationship to scrolling. When placing a child in TEXT_WINDOW_WIDGET, scrolling is irrelevant, the child floats above all scrollable areas. But when placing a child in one of the scrollable windows (border windows or text window), you'll need to compute the child's correct position in buffer coordinates any time scrolling occurs or buffer changes occur, and then call move_child() to update the child's position. Unfortunately there's no good way to detect that scrolling has occurred, using the current API; a possible hack would be to update all child positions when the scroll adjustments change or the text buffer changes. See bug 64518 on bugzilla.gnome.org for status of fixing this issue.

bool Inti::Gtk::TextView::backward_display_line | ( | TextIter & | iter | ) |

  | Moves the given iter backward by one display (wrapped) line. Parameters:
  iter | A TextIter.
Returns: true if iter was moved and is not on the end iterator. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the TextBuffer.

bool Inti::Gtk::TextView::backward_display_line_start | ( | TextIter & | iter | ) |

  | Moves the given iter backward to the next display line start. Parameters:
  iter | A TextIter.
Returns: true if iter was moved and is not on the end iterator. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the TextBuffer.

void Inti::Gtk::TextView::buffer_to_window_coords | ( | TextWindowType | window_type,
|  | int | buffer_x,
|  | int | buffer_y,
|  | int * | window_x,
|  | int * | window_y
| ) |

  | Converts coordinate (buffer_x, buffer_y) to coordinates for the window window_type, and stores the result in (window_x, window_y). Parameters:
  window_type | A TextWindowType, except TEXT_WINDOW_PRIVATE.
  buffer_x | The buffer x coordinate.
  buffer_y | The buffer y coordinate.
  window_x | The return location for the window x coordinate.
  window_y | The return location for the window y coordinate.
Note that you can't convert coordinates for a nonexisting window (see set_border_window_size()).

bool Inti::Gtk::TextView::forward_display_line | ( | TextIter & | iter | ) |

  | Moves the given iter forward by one display (wrapped) line. Parameters:
  iter | A TextIter.
Returns: true if iter was moved and is not on the end iterator. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the TextBuffer.

bool Inti::Gtk::TextView::forward_display_line_end | ( | TextIter & | iter | ) |

  | Moves the given iter forward to the next display line end. Parameters:
  iter | A TextIter.
Returns: true if iter was moved and is not on the end iterator. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view's width; paragraphs are the same in all views, since they depend on the contents of the TextBuffer.

int Inti::Gtk::TextView::get_border_window_size | ( | TextWindowType | type | ) | const

  | Gets the width of the specified border window (see set_border_window_size()). , Parameters:
  type | The window to return the size from
Returns: The width of the window.

TextBuffer* Inti::Gtk::TextView::get_buffer | ( |  | ) | const

| Returns the TextBuffer being displayed by this text view. The reference count on the buffer is not incremented; the caller of this method won't own a new reference.

bool Inti::Gtk::TextView::get_cursor_visible | ( |  | ) | const

| Find out whether the cursor is being displayed. Returns: Whether the insertion mark is visible.

Pointer<TextAttributes> Inti::Gtk::TextView::get_default_attributes | ( |  | ) | const

| Obtains a copy of the default text attributes. Returns: A copy of the TextAttributes. These are the attributes used for text unless a tag overrides them. You'd typically pass the default attributes in to Gtk::TextIter::get_attributes() in order to get the attributes in effect at a given text position.

bool Inti::Gtk::TextView::get_editable | ( |  | ) | const

| Returns the default editability of the TextView. Returns: Whether text is editable by default. Tags in the buffer may override this setting for some ranges of text.

int Inti::Gtk::TextView::get_indent | ( |  | ) | const

| Gets the default indentation of paragraphs in the text view. Returns: The number of pixels of indentation. Tags in the view's buffer may override the default. The indentation may be negative.

TextIter Inti::Gtk::TextView::get_iter_at_location | ( | int | x,
|  | int | y
| ) | const

  | Retrieves the iterator at buffer coordinates x and y. Parameters:
  x | The x position, in buffer coordinates.
  y | The y position, in buffer coordinates.
Returns: A TextIter. Buffer coordinates are coordinates for the entire buffer, not just the currently displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with window_to_buffer_coords().

Gdk::Rectangle Inti::Gtk::TextView::get_iter_location | ( | const TextIter & | iter | ) | const

  | Returns a rectangle which roughly contains the character at iter. Parameters:
  iter | A TextIter.
The rectangle position is in buffer coordinates; use buffer_to_window_coords() to convert these coordinates to coordinates for one of the windows in the text view.

void Inti::Gtk::TextView::get_iter_location | ( | const TextIter & | iter,
|  | Gdk::Rectangle & | location
| ) |

  | Gets a rectangle which roughly contains the character at iter. Parameters:
  iter | A TextIter.
  location | The bounds of the character at iter.
The rectangle position is in buffer coordinates; use buffer_to_window_coords() to convert these coordinates to coordinates for one of the windows in the text view.

Justification Inti::Gtk::TextView::get_justification | ( |  | ) | const

| Returns the default justification of paragraphs in the text view. Tags in the buffer may override the default.

int Inti::Gtk::TextView::get_left_margin | ( |  | ) | const

| Returns the default left margin size of paragraphs in the text_view. Tags in the buffer may override the default.

TextIter Inti::Gtk::TextView::get_line_at_y | ( | int | y | ) | const

  | Returns the TextIter at the start of the line containing the coordinate y. Parameters:
  y | A Y coordinate.
y is in buffer coordinates, convert from window coordinates with window_to_buffer_coords().

void Inti::Gtk::TextView::get_line_at_y | ( | TextIter & | target_iter,
|  | int | y,
|  | int * | line_top
| ) | const

  | Gets the TextIter at the start of the line containing the coordinate y. Parameters:
  target_iter | A TextIter.
  y | A Y coordinate.
  line_top | The return location for top coordinate of the line.
y is in buffer coordinates, convert from window coordinates with window_to_buffer_coords(). If non-null, line_top will be filled with the coordinate of the top edge of the line.

int Inti::Gtk::TextView::get_line_height | ( | const TextIter & | iter | ) | const

  | Gets the height of the line containing iter. Parameters:
  iter | A TextIter.
Returns: The height of the line.

int Inti::Gtk::TextView::get_line_y | ( | const TextIter & | iter | ) | const

  | Gets the y coordinate of the top of the line containing iter. Parameters:
  iter | A TextIter.
Returns: The y coordinate, as a buffer coordinate.

void Inti::Gtk::TextView::get_line_yrange | ( | const TextIter & | iter,
|  | int * | y,
|  | int * | height
| ) | const

  | Gets the y coordinate of the top of the line containing iter, and the height of the line. Parameters:
  iter | A TextIter.
  y | The return location for a y coordinate.
  height | The return location for a height.
The coordinate is a buffer coordinate; convert to window coordinates with buffer_to_window_coords().

int Inti::Gtk::TextView::get_pixels_above_lines | ( |  | ) | const

| Returns the default number of pixels to put above paragraphs. Tags in the buffer may override the default.

int Inti::Gtk::TextView::get_pixels_below_lines | ( |  | ) | const

| Returns the default number of blank pixels below paragraphs. Tags in the buffer may override the default.

int Inti::Gtk::TextView::get_pixels_inside_wrap | ( |  | ) | const

| Returns the default number of pixels of blank space between wrapped lines. Tags in the buffer may override the default.

int Inti::Gtk::TextView::get_right_margin | ( |  | ) | const

| Returns the default right margin for text in the text view. Tags in the buffer may override the default.

Pointer<Pango::TabArray> Inti::Gtk::TextView::get_tabs | ( |  | ) | const

| Gets the default tabs for the text view. Returns: A copy of default tab array, or null if "standard" tabs are used. Tags in the buffer may override the defaults. The returned array will be null if "standard" (8-space) tabs are used.

Gdk::Rectangle Inti::Gtk::TextView::get_visible_rect | ( |  | ) | const

| Returns a rectangle filled with the currently visible region of the buffer, in buffer coordinates. Convert to window coordinates with buffer_to_window_coords().

void Inti::Gtk::TextView::get_visible_rect | ( | Gdk::Rectangle & | visible_rect | ) |

  | Fills visible_rect with the currently visible region of the buffer, in buffer coordinates. Parameters:
  visible_rect | The rectangle to fill.
Convert to window coordinates with buffer_to_window_coords().

Gdk::Window* Inti::Gtk::TextView::get_window | ( | TextWindowType | window_type | ) | const

  | Retrieves the Gdk::Window corresponding to an area of the text view; possible windows include the overall widget window, child windows on the left, right, top, bottom, and the window that displays the text buffer. Parameters:
  window_type | The window to get.
Returns: A Gdk::Window, or null. Windows are null and nonexistent if their width or height is 0, and are nonexistent before the widget has been realized.

TextWindowType Inti::Gtk::TextView::get_window_type | ( | const Gdk::Window & | window | ) | const

  | Usually used to find out which window an event corresponds to. Parameters:
  window | A window type.
Returns: The window type. If you connect to an event signal on the TextView, this method should be called on event->window to see which window it was.

WrapMode Inti::Gtk::TextView::get_wrap_mode | ( |  | ) | const

| Gets the line wrapping for the view. Returns: The line wrap setting.

void Inti::Gtk::TextView::move_child | ( | const Widget & | child,
|  | int | xpos,
|  | int | ypos
| ) |

  | Updates the position of a child, as for add_child_in_window(). Parameters:
  child | The child widget already added to the text view.
  xpos | The new X position in window coordinates.
  ypos | The new Y position in window coordinates.

bool Inti::Gtk::TextView::move_mark_onscreen | ( | const TextMark & | mark | ) |

  | Moves a mark within the buffer so that it's located within the currently-visible text area. Parameters:
  mark | A TextMark.
Returns: true if the mark moved (wasn't already onscreen).

bool Inti::Gtk::TextView::move_visually | ( | TextIter & | iter,
|  | int | count
| ) |

  | Moves iter up or down by count display (wrapped) lines (see forward_display_line() for an explanation of display lines vs. paragraphs). Parameters:
  iter | A TextIter.
  count | THe number of lines to move.
Returns: true if iter moved and is not on the end iterator.

virtual void Inti::Gtk::TextView::on_insert_at_cursor | ( | const String & | str | ) | `[protected, virtual]`

  | Called when text is inserted into the buffer at the current cursor position. Parameters:
  str | The new text to insert.

virtual void Inti::Gtk::TextView::on_populate_popup | ( | Menu & | menu | ) | `[protected, virtual]`

  | Called when the text view displays its context-sensitive menu. Parameters:
  menu | The popup menu.

virtual void Inti::Gtk::TextView::on_set_scroll_adjustments | ( | Adjustment * | hadjustment,
|  | Adjustment * | vadjustment
| ) | `[protected, virtual]`

  | Called when a text view is added to a scrolling aware parent. Parameters:
  hadjustment | The horizontal adjustment.
  vadjustment | The vertical adjustment.

bool Inti::Gtk::TextView::place_cursor_onscreen | ( |  | ) |

| Moves the cursor to the currently visible region of the buffer, it it isn't there already. Returns: true if the cursor had to be moved.

void Inti::Gtk::TextView::scroll_mark_onscreen | ( | const TextMark & | mark | ) |

  | Scrolls the text view the minimum distance such that mark is contained within the visible area of the widget. Parameters:
  mark | A mark in the buffer for the text view.

bool Inti::Gtk::TextView::scroll_to_iter | ( | const TextIter & | iter,
|  | double | within_margin,
|  | bool | use_align,
|  | double | xalign,
|  | double | yalign
| ) |

  | Scrolls the text view so that iter is on the screen in the position indicated by xalign and yalign. Parameters:
  iter | A TextIter.
  within_margin | The margin as a (0.0,0.5) fraction of screen size.
  use_align | Whether to use alignment arguments (if false, just get the iter onscreen).
  xalign | The horizontal alignment of iter within visible area.
  yalign | The vertical alignment of iter within visible area.
Returns: true if scrolling occurred. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align is false, the text scrolls the minimal distance to get the iter onscreen, possibly not scrolling at all. The effective screen for purposes of this method is reduced by a margin of size within_margin. Note this method uses the currently computed height of the lines in the text buffer. The line heights are computed in an idle handler; so this method may not have the desired effect if it's called before the height computations. To avoid oddness, consider using scroll_to_mark() which saves a point to be scrolled to after line validation.

void Inti::Gtk::TextView::scroll_to_mark | ( | const TextMark & | mark,
|  | double | within_margin,
|  | bool | use_align,
|  | double | xalign,
|  | double | yalign
| ) |

  | Scrolls the text view so that mark is on the screen in the position indicated by xalign and yalign. Parameters:
  mark | A TextMark.
  within_margin | The margin as a (0.0,0.5) fraction of screen size.
  use_align | Whether to use alignment arguments (if false, just get the mark onscreen).
  xalign | The horizontal alignment of mark within visible area.
  yalign | The vertical alignment of mark within visible area.
An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align is false, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this method is reduced by a margin of size within_margin.

void Inti::Gtk::TextView::set_border_window_size | ( | TextWindowType | window_type,
|  | int | size
| ) |

  | Sets the width of TEXT_WINDOW_LEFT or TEXT_WINDOW_RIGHT, or the height of TEXT_WINDOW_TOP or TEXT_WINDOW_BOTTOM. Parameters:
  window_type | The window to affect.
  size | The width or height of the window.
Automatically destroys the corresponding window if the size is set to 0, and creates the window if the size is set to non-zero. This method can only be used for the "border windows," it doesn't work with TEXT_WINDOW_WIDGET, TEXT_WINDOW_TEXT, or TEXT_WINDOW_PRIVATE.

void Inti::Gtk::TextView::set_buffer | ( | TextBuffer * | buffer | ) |

  | Sets buffer as the buffer being displayed by text_view. Parameters:
  buffer | A TextBuffer.
The previous buffer displayed by the text view is unreferenced, and a reference is added to buffer. If you owned a reference to buffer before passing it to this method, you must remove that reference yourself; TextView will not "adopt" it.

void Inti::Gtk::TextView::set_cursor_visible | ( | bool | setting | ) |

  | Toggles whether the insertion point is displayed. Parameters:
  setting | Whether to show the insertion cursor.
A buffer with no editable text probably shouldn't have a visible cursor, so you may want to turn the cursor off.

void Inti::Gtk::TextView::set_editable | ( | bool | setting | ) |

  | Sets the default editability of the TextView. You can override this default setting with tags in the buffer, using the "editable" attribute of tags. Parameters:
  setting | Whether the text view is editable.

void Inti::Gtk::TextView::set_indent | ( | int | indent | ) |

  | Sets the default indentation for paragraphs in the text view. Parameters:
  indent | The indentation in pixels
Tags in the buffer may override the default.

void Inti::Gtk::TextView::set_justification | ( | Justification | justification | ) |

  | Sets the default justification of text in the text view. Parameters:
  justification | The justification.
Tags in the view's buffer may override the default.

void Inti::Gtk::TextView::set_left_margin | ( | int | left_margin | ) |

  | Sets the default left margin for text in text_view. Parameters:
  left_margin | The left margin in pixels.
Tags in the buffer may override the default.

void Inti::Gtk::TextView::set_pixels_above_lines | ( | int | pixels_above_lines | ) |

  | Sets the default number of blank pixels above paragraphs in text_view. Parameters:
  pixels_above_lines | The pixels above paragraphs.
Tags in the buffer for text view may override the defaults.

void Inti::Gtk::TextView::set_pixels_below_lines | ( | int | pixels_below_lines | ) |

  | Sets the default number of pixels of blank space to put below paragraphs. Parameters:
  pixels_below_lines | The pixels below paragraphs.
May be overridden by tags applied to text_view's buffer.

void Inti::Gtk::TextView::set_pixels_inside_wrap | ( | int | pixels_inside_wrap | ) |

  | Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph. Parameters:
  pixels_inside_wrap | The default number of pixels between wrapped lines.
May be overridden by tags in text_view's buffer.

void Inti::Gtk::TextView::set_right_margin | ( | int | right_margin | ) |

  | Sets the default right margin for text in the text view. Parameters:
  right_margin | The right margin in pixels.
Tags in the buffer may override the default.

void Inti::Gtk::TextView::set_tabs | ( | const Pango::TabArray & | tabs | ) |

  | Sets the default tab stops for paragraphs in the text view. Parameters:
  tabs | The tabs as a Pango::TabArray.
Tags in the buffer may override the default.

void Inti::Gtk::TextView::set_wrap_mode | ( | WrapMode | wrap_mode | ) |

  | Sets the line wrapping for the view. Parameters:
  wrap_mode | A WrapMode.

bool Inti::Gtk::TextView::starts_display_line | ( | const TextIter & | iter | ) |

  | Determines whether iter is at the start of a display line (see forward_display_line() for an explanation of display lines vs. paragraphs). Parameters:
  iter | A TextIter.
Returns: true if iter begins a wrapped line.

void Inti::Gtk::TextView::window_to_buffer_coords | ( | TextWindowType | window_type,
|  | int | window_x,
|  | int | window_y,
|  | int * | buffer_x,
|  | int * | buffer_y
| ) |

  | Converts coordinates on the window identified by window_type to buffer coordinates, storing the result in (buffer_x,buffer_y). Parameters:
  window_type | A TextWindowType, except TEXT_WINDOW_PRIVATE.
  window_x | The window x coordinate.
  window_y | The window y coordinate.
  buffer_x | The return location for the buffer x coordinate.
  buffer_y | The return location for the buffer y coordinate.
Note that you can't convert coordinates for a nonexisting window (see set_border_window_size()).

The documentation for this class was generated from the following file:

- textview.h

Main Page - Footer