Main Page Widgets Namespaces Book

# Gtk::TextView Class Reference
[Widgets, Container Widgets, TextView Classes]

Inheritance diagram for Gtk::TextView:

[legend]
List of all members.

## Detailed Description

Multi-line text editing widget.

It displays a Gtk::TextBuffer.

## Public Member Functions

virtual | ~TextView ()
GtkTextView* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkTextView* | gobj () const
| Provides access to the underlying C GtkObject.
| TextView ()
| TextView (const Glib::RefPtr<TextBuffer>& buffer)
void | set_buffer (const Glib::RefPtr<TextBuffer>& buffer)
| Sets buffer as the buffer being displayed by text_view .
Glib::RefPtr<TextBuffer> | get_buffer ()
| Returns the Gtk::TextBuffer being displayed by this text view.
Glib::RefPtr<const TextBuffer> | get_buffer () const
| Returns the Gtk::TextBuffer being displayed by this text view.
bool | scroll_to_iter (TextBuffer::iterator& iter, double within_margin)
bool | scroll_to_iter (TextBuffer::iterator& iter, double within_margin, double xalign, double yalign)
void | scroll_to_mark (const Glib::RefPtr<TextBuffer::Mark>& mark, double within_margin)
void | scroll_to_mark (const Glib::RefPtr<TextBuffer::Mark>& mark, double within_margin, double xalign, double yalign)
void | scroll_mark_onscreen (const Glib::RefPtr<TextBuffer::Mark>& mark)
| Scrolls text_view the minimum distance such that mark is contained within the visible area of the widget.
bool | move_mark_onscreen (const Glib::RefPtr<TextBuffer::Mark>& 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 | get_visible_rect (Gdk::Rectangle& visible_rect)
| Fills visible_rect with the currently-visible region of the buffer, in buffer coordinates.
void | set_cursor_visible (bool setting=true)
| Toggles whether the insertion point is displayed.
bool | get_cursor_visible () const
| Find out whether the cursor is being displayed.
void | get_iter_location (const TextBuffer::iterator& iter, Gdk::Rectangle& location)
| Gets a rectangle which roughly contains the character at iter .
void | get_iter_at_location (TextBuffer::iterator& iter, int x, int y)
| Retrieves the iterator at buffer coordinates x and y .
void | get_line_yrange (const TextBuffer::iterator& iter, int& y, int& height)
| Gets the y coordinate of the top of the line containing iter , and the height of the line.
void | get_line_at_y (TextBuffer::iterator& target_iter, int y, int& line_top)
| Gets the Gtk::TextIter at the start of the line containing the coordinate y .
void | buffer_to_window_coords (TextWindowType win, int buffer_x, int buffer_y, int& window_x, int& window_y)
| Converts coordinate ( buffer_x , buffer_y ) to coordinates for the window win , and stores the result in ( window_x , window_y ).
void | window_to_buffer_coords (TextWindowType win, int window_x, int window_y, int& buffer_x, int& buffer_y)
| Converts coordinates on the window identified by win to buffer coordinates, storing the result in ( buffer_x , buffer_y ).
Glib::RefPtr<Gdk::Window> | get_window (TextWindowType win)
| 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.
Glib::RefPtr<const Gdk::Window> | get_window (TextWindowType win) 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 Glib::RefPtr<Gdk::Window>& window)
| Usually used to find out which window an event corresponds to.
void | set_border_window_size (TextWindowType type, int size)
| Sets the width of Gtk::TEXT_WINDOW_LEFT or Gtk::TEXT_WINDOW_RIGHT, or the height of Gtk::TEXT_WINDOW_TOP or Gtk::TEXT_WINDOW_BOTTOM.
int | get_border_window_size (TextWindowType type)
| Gets the width of the specified border window.
bool | forward_display_line (TextBuffer::iterator& iter)
| Moves the given iter forward by one display (wrapped) line.
bool | backward_display_line (TextBuffer::iterator& iter)
| Moves the given iter backward by one display (wrapped) line.
bool | forward_display_line_end (TextBuffer::iterator& iter)
| Moves the given iter forward to the next display line end.
bool | backward_display_line_start (TextBuffer::iterator& iter)
| Moves the given iter backward to the next display line start.
bool | starts_display_line (const TextBuffer::iterator& iter)
| Determines whether iter is at the start of a display line.
bool | move_visually (TextBuffer::iterator& iter, int count)
| Move the iterator a given number of characters visually, treating it as the strong cursor position.
void | add_child_at_anchor (Widget& child, const Glib::RefPtr<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 (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.
WrapMode | get_wrap_mode ()
| Gets the line wrapping for the view.
void | set_editable (bool setting=true)
| Sets the default editability of the Gtk::TextView.
bool | get_editable () const
| Returns the default editability of the Gtk::TextView.
void | set_pixels_above_lines (int pixels_above_lines)
| Sets the default number of blank pixels above paragraphs in text_view .
int | get_pixels_above_lines ()
| Gets the default number of pixels to put above paragraphs.
void | set_pixels_below_lines (int pixels_below_lines)
| Sets the default number of pixels of blank space to put below paragraphs in text_view .
int | get_pixels_below_lines ()
| Gets the value set by set_pixels_below_lines().
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.
int | get_pixels_inside_wrap ()
| Gets the value set by set_pixels_inside_wrap().
void | set_justification (Justification justification)
| Sets the default justification of text in text_view .
Justification | get_justification ()
| Gets the default justification of paragraphs in text_view .
void | set_left_margin (int left_margin)
| Sets the default left margin for text in text_view .
int | get_left_margin ()
| Gets the default left margin size of paragraphs in the text_view .
void | set_right_margin (int right_margin)
| Sets the default right margin for text in the text view.
int | get_right_margin ()
| Gets the default right margin for text in text_view .
void | set_indent (int indent)
| Sets the default indentation for paragraphs in text_view .
int | get_indent ()
| Gets the default indentation of paragraphs in text_view .
void | set_tabs (Pango::TabArray& tabs)
| Sets the default tab stops for paragraphs in text_view .
Pango::TabArray | get_tabs ()
| Gets the default tabs for text_view .
TextAttributes | get_default_attributes ()
| Obtains a copy of the default text attributes.
Glib::SignalProxy2< void, Adjustment*, Adjustment* > | signal_set_scroll_adjustments ()
Glib::SignalProxy1< void, Menu* > | signal_populate_popup ()
Glib::SignalProxy3< void, MovementStep, int, bool > | signal_move_cursor ()
Glib::SignalProxy2< void, int, bool > | signal_page_horizontally ()
Glib::SignalProxy0<void> | signal_set_anchor ()
Glib::SignalProxy1< void, const Glib::ustring& > | signal_insert_at_cursor ()
Glib::SignalProxy2< void, DeleteType, int > | signal_delete_from_cursor ()
Glib::SignalProxy0<void> | signal_cut_clipboard ()
Glib::SignalProxy0<void> | signal_copy_clipboard ()
Glib::SignalProxy0<void> | signal_paste_clipboard ()
Glib::SignalProxy0<void> | signal_toggle_overwrite ()
Glib::SignalProxy1< void, DirectionType > | signal_move_focus ()
Glib::PropertyProxy<int> | property_pixels_above_lines ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> | property_pixels_below_lines ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> | property_pixels_inside_wrap ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> | property_editable ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<WrapMode> | property_wrap_mode ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Justification> | property_justification ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> | property_left_margin ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> | property_right_margin ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> | property_indent ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Pango::TabArray> | property_tabs ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> | property_cursor_visible ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.

## Protected Member Functions

virtual void | on_set_scroll_adjustments (Adjustment* hadjustment, Adjustment* vadjustment)
virtual void | on_populate_popup (Menu* menu)
virtual void | on_move_cursor (MovementStep step, int count, bool extend_selection)
virtual void | on_page_horizontally (int count, bool extend_selection)
virtual void | on_set_anchor ()
virtual void | on_insert_at_cursor (const Glib::ustring& str)
virtual void | on_delete_from_cursor (DeleteType type, int count)
virtual void | on_cut_clipboard ()
virtual void | on_copy_clipboard ()
virtual void | on_paste_clipboard ()
virtual void | on_toggle_overwrite ()
virtual void | on_move_focus (DirectionType direction)

## Related Functions

(Note that these are not member functions.)
Gtk::TextView* | wrap (GtkTextView* object, bool take_copy=false)

## Constructor & Destructor Documentation

virtual Gtk::TextView::~TextView | ( |  | ) | `[virtual]`

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

Gtk::TextView::TextView | ( | const Glib::RefPtr<TextBuffer>& | buffer | ) | `[explicit]`

## Member Function Documentation

void Gtk::TextView::add_child_at_anchor | ( | Widget& | child,
|  | const Glib::RefPtr<TextChildAnchor>& | anchor
| ) |

Adds a child widget in the text buffer, at the given anchor .

Parameters:

  child | A Gtk::Widget.
  anchor | A Gtk::TextChildAnchor in the Gtk::TextBuffer for text_view .

void 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.

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 Gtk::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.

Parameters:

  child | A Gtk::Widget.
  which_window | Which window the child should appear in.
  xpos | X position of child in window coordinates.
  ypos | Y position of child in window coordinates.

bool Gtk::TextView::backward_display_line | ( | TextBuffer::iterator& | iter | ) |

Moves the given iter backward by one display (wrapped) line.

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 Gtk::TextBuffer.

Parameters:

  iter | A Gtk::TextIter.

Returns:
  `true` if iter was moved and is not on the end iterator.

bool Gtk::TextView::backward_display_line_start | ( | TextBuffer::iterator& | iter | ) |

Moves the given iter backward to the next display line start.

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 Gtk::TextBuffer.

Parameters:

  iter | A Gtk::TextIter.

Returns:
  `true` if iter was moved and is not on the end iterator.

void Gtk::TextView::buffer_to_window_coords | ( | TextWindowType | win,
|  | int | buffer_x,
|  | int | buffer_y,
|  | int& | window_x,
|  | int& | window_y
| ) |

Converts coordinate ( buffer_x , buffer_y ) to coordinates for the window win , and stores the result in ( window_x , window_y ).

Note that you can't convert coordinates for a nonexisting window (see set_border_window_size()).

Parameters:

  win | A Gtk::TextWindowType except Gtk::TEXT_WINDOW_PRIVATE.
  buffer_x | Buffer x coordinate.
  buffer_y | Buffer y coordinate.
  window_x | Window x coordinate return location.
  window_y | Window y coordinate return location.

bool Gtk::TextView::forward_display_line | ( | TextBuffer::iterator& | iter | ) |

Moves the given iter forward by one display (wrapped) line.

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 Gtk::TextBuffer.

Parameters:

  iter | A Gtk::TextIter.

Returns:
  `true` if iter was moved and is not on the end iterator.

bool Gtk::TextView::forward_display_line_end | ( | TextBuffer::iterator& | iter | ) |

Moves the given iter forward to the next display line end.

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 Gtk::TextBuffer.

Parameters:

  iter | A Gtk::TextIter.

Returns:
  `true` if iter was moved and is not on the end iterator.

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

Gets the width of the specified border window.

See set_border_window_size().

Parameters:

  type | Window to return size from.

Returns:
  Width of window.

Glib::RefPtr<const TextBuffer> Gtk::TextView::get_buffer | ( |  | ) | const

Returns the Gtk::TextBuffer being displayed by this text view.

The reference count on the buffer is not incremented; the caller of this function won't own a new reference.

Returns:
  A Gtk::TextBuffer.

Glib::RefPtr<TextBuffer> Gtk::TextView::get_buffer | ( |  | ) |

Returns the Gtk::TextBuffer being displayed by this text view.

The reference count on the buffer is not incremented; the caller of this function won't own a new reference.

Returns:
  A Gtk::TextBuffer.

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

Find out whether the cursor is being displayed.

Returns:
  Whether the insertion mark is visible.

TextAttributes Gtk::TextView::get_default_attributes | ( |  | ) |

Obtains a copy of the default text attributes.

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.

Returns:
  A new Gtk::TextAttributes.

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

Returns the default editability of the Gtk::TextView.

Tags in the buffer may override this setting for some ranges of text.

Returns:
  Whether text is editable by default.

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

Gets the default indentation of paragraphs in text_view .

Tags in the view's buffer may override the default. The indentation may be negative.

Returns:
  Number of pixels of indentation.

void Gtk::TextView::get_iter_at_location | ( | TextBuffer::iterator& | iter,
|  | int | x,
|  | int | y
| ) |

Retrieves the iterator at buffer coordinates x and y .

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().

Parameters:

  iter | A Gtk::TextIter.
  x | X position, in buffer coordinates.
  y | Y position, in buffer coordinates.

void Gtk::TextView::get_iter_location | ( | const TextBuffer::iterator& | iter,
|  | Gdk::Rectangle& | location
| ) |

Gets a rectangle which roughly contains 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.

Parameters:

  iter | A Gtk::TextIter.
  location | Bounds of the character at iter .

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

Gets the default justification of paragraphs in text_view .

Tags in the buffer may override the default.

Returns:
  Default justification.

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

Gets the default left margin size of paragraphs in the text_view .

Tags in the buffer may override the default.

Returns:
  Left margin in pixels.

void Gtk::TextView::get_line_at_y | ( | TextBuffer::iterator& | target_iter,
|  | int | y,
|  | int& | line_top
| ) |

Gets the Gtk::TextIter at the start of the line containing the coordinate y .

y is in buffer coordinates, convert from window coordinates with window_to_buffer_coords(). If non-`0`, line_top will be filled with the coordinate of the top edge of the line.

Parameters:

  target_iter | A Gtk::TextIter.
  y | A y coordinate.
  line_top | Return location for top coordinate of the line.

void Gtk::TextView::get_line_yrange | ( | const TextBuffer::iterator& | iter,
|  | int& | y,
|  | int& | height
| ) |

Gets the y coordinate of the top of the line containing iter , and the height of the line.

The coordinate is a buffer coordinate; convert to window coordinates with buffer_to_window_coords().

Parameters:

  iter | A Gtk::TextIter.
  y | Return location for a y coordinate.
  height | Return location for a height.

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

Gets the default number of pixels to put above paragraphs.

Returns:
  Default number of pixels above paragraphs.

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

Gets the value set by set_pixels_below_lines().

Returns:
  Default number of blank pixels below paragraphs.

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

Gets the value set by set_pixels_inside_wrap().

Returns:
  Default number of pixels of blank space between wrapped lines.

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

Gets the default right margin for text in text_view .

Tags in the buffer may override the default.

Returns:
  Right margin in pixels.

Pango::TabArray Gtk::TextView::get_tabs | ( |  | ) |

Gets the default tabs for text_view .

Tags in the buffer may override the defaults. The returned array will be `0` if "standard" (8-space) tabs are used.

Returns:
  Copy of default tab array, or `0` if "standard" tabs are used.

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

Fills visible_rect with the currently-visible region of the buffer, in buffer coordinates.

Convert to window coordinates with buffer_to_window_coords().

Parameters:

  visible_rect | Rectangle to fill.

Glib::RefPtr<const Gdk::Window> Gtk::TextView::get_window | ( | TextWindowType | win | ) | 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.

Windows are `0` and nonexistent if their width or height is 0, and are nonexistent before the widget has been realized.

Parameters:

  win | Window to get.

Returns:
  A Gdk::Window, or `0`.

Glib::RefPtr<Gdk::Window> Gtk::TextView::get_window | ( | TextWindowType | win | ) |

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.

Windows are `0` and nonexistent if their width or height is 0, and are nonexistent before the widget has been realized.

Parameters:

  win | Window to get.

Returns:
  A Gdk::Window, or `0`.

TextWindowType Gtk::TextView::get_window_type | ( | const Glib::RefPtr<Gdk::Window>& | window | ) |

Usually used to find out which window an event corresponds to.

If you connect to an event signal on text_view , this function should be called on `event->window` to see which window it was.

Parameters:

  window | A window type.

Returns:
  The window type.

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

Gets the line wrapping for the view.

Returns:
  The line wrap setting.

const GtkTextView* Gtk::TextView::gobj | ( |  | ) | const`[inline]`

| Provides access to the underlying C GtkObject. Reimplemented from Gtk::Container.

GtkTextView* Gtk::TextView::gobj | ( |  | ) | `[inline]`

| Provides access to the underlying C GtkObject. Reimplemented from Gtk::Container.

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

Updates the position of a child, as for add_child_in_window().

Parameters:

  child | Child widget already added to the text view.
  xpos | New X position in window coordinates.
  ypos | New Y position in window coordinates.

bool Gtk::TextView::move_mark_onscreen | ( | const Glib::RefPtr<TextBuffer::Mark>& | mark | ) |

Moves a mark within the buffer so that it's located within the currently-visible text area.

Parameters:

  mark | A Gtk::TextMark.

Returns:
  `true` if the mark moved (wasn't already onscreen).

bool Gtk::TextView::move_visually | ( | TextBuffer::iterator& | iter,
|  | int | count
| ) |

Move the iterator a given number of characters visually, treating it as the strong cursor position.

If count is positive, then the new strong cursor position will be count positions to the right of the old cursor position. If count is negative then the new strong cursor position will be count positions to the left of the old cursor position.

In the presence of bidirection text, the correspondence between logical and visual order will depend on the direction of the current run, and there may be jumps when the cursor is moved off of the end of a run.

Parameters:

  iter | A Gtk::TextIter.
  count | Number of characters to move (negative moves left, positive moves right).

Returns:
  `true` if iter moved and is not on the end iterator.

virtual void Gtk::TextView::on_copy_clipboard | ( |  | ) | `[protected, virtual]`

virtual void Gtk::TextView::on_cut_clipboard | ( |  | ) | `[protected, virtual]`

virtual void Gtk::TextView::on_delete_from_cursor | ( | DeleteType | type,
|  | int | count
| ) | `[protected, virtual]`

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

virtual void Gtk::TextView::on_move_cursor | ( | MovementStep | step,
|  | int | count,
|  | bool | extend_selection
| ) | `[protected, virtual]`

virtual void Gtk::TextView::on_move_focus | ( | DirectionType | direction | ) | `[protected, virtual]`

virtual void Gtk::TextView::on_page_horizontally | ( | int | count,
|  | bool | extend_selection
| ) | `[protected, virtual]`

virtual void Gtk::TextView::on_paste_clipboard | ( |  | ) | `[protected, virtual]`

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

virtual void Gtk::TextView::on_set_anchor | ( |  | ) | `[protected, virtual]`

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

virtual void Gtk::TextView::on_toggle_overwrite | ( |  | ) | `[protected, virtual]`

bool 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.

Glib::PropertyProxy<bool> Gtk::TextView::property_cursor_visible | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::TextView::property_editable | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::TextView::property_indent | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Justification> Gtk::TextView::property_justification | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::TextView::property_left_margin | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::TextView::property_pixels_above_lines | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::TextView::property_pixels_below_lines | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::TextView::property_pixels_inside_wrap | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::TextView::property_right_margin | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Pango::TabArray> Gtk::TextView::property_tabs | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<WrapMode> Gtk::TextView::property_wrap_mode | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::TextView::scroll_mark_onscreen | ( | const Glib::RefPtr<TextBuffer::Mark>& | mark | ) |

Scrolls 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 text_view .

bool Gtk::TextView::scroll_to_iter | ( | TextBuffer::iterator& | iter,
|  | double | within_margin,
|  | double | xalign,
|  | double | yalign
| ) |

bool Gtk::TextView::scroll_to_iter | ( | TextBuffer::iterator& | iter,
|  | double | within_margin
| ) |

void Gtk::TextView::scroll_to_mark | ( | const Glib::RefPtr<TextBuffer::Mark>& | mark,
|  | double | within_margin,
|  | double | xalign,
|  | double | yalign
| ) |

void Gtk::TextView::scroll_to_mark | ( | const Glib::RefPtr<TextBuffer::Mark>& | mark,
|  | double | within_margin
| ) |

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

Sets the width of Gtk::TEXT_WINDOW_LEFT or Gtk::TEXT_WINDOW_RIGHT, or the height of Gtk::TEXT_WINDOW_TOP or Gtk::TEXT_WINDOW_BOTTOM.

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 function can only be used for the "border windows," it doesn't work with Gtk::TEXT_WINDOW_WIDGET, Gtk::TEXT_WINDOW_TEXT, or Gtk::TEXT_WINDOW_PRIVATE.

Parameters:

  type | Window to affect.
  size | Width or height of the window.

void Gtk::TextView::set_buffer | ( | const Glib::RefPtr<TextBuffer>& | buffer | ) |

Sets buffer as the buffer being displayed by text_view .

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 function, you must remove that reference yourself; Gtk::TextView will not "adopt" it.

Parameters:

  buffer | A Gtk::TextBuffer.

void Gtk::TextView::set_cursor_visible | ( | bool | setting = true | ) |

Toggles whether the insertion point is displayed.

A buffer with no editable text probably shouldn't have a visible cursor, so you may want to turn the cursor off.

Parameters:

  setting | Whether to show the insertion cursor.

void Gtk::TextView::set_editable | ( | bool | setting = true | ) |

Sets the default editability of the Gtk::TextView.

You can override this default setting with tags in the buffer, using the "editable" attribute of tags.

Parameters:

  setting | Whether it's editable.

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

Sets the default indentation for paragraphs in text_view .

Tags in the buffer may override the default.

Parameters:

  indent | Indentation in pixels.

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

Sets the default justification of text in text_view .

Tags in the view's buffer may override the default.

Parameters:

  justification | Justification.

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

Sets the default left margin for text in text_view .

Tags in the buffer may override the default.

Parameters:

  left_margin | Left margin in pixels.

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

Sets the default number of blank pixels above paragraphs in text_view .

Tags in the buffer for text_view may override the defaults.

Parameters:

  pixels_above_lines | Pixels above paragraphs.

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

Sets the default number of pixels of blank space to put below paragraphs in text_view .

May be overridden by tags applied to text_view 's buffer.

Parameters:

  pixels_below_lines | Pixels below paragraphs.

void 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.

May be overridden by tags in text_view 's buffer.

Parameters:

  pixels_inside_wrap | Default number of pixels between wrapped lines.

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

Sets the default right margin for text in the text view.

Tags in the buffer may override the default.

Parameters:

  right_margin | Right margin in pixels.

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

Sets the default tab stops for paragraphs in text_view .

Tags in the buffer may override the default.

Parameters:

  tabs | Tabs as a Pango::TabArray.

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

Sets the line wrapping for the view.

Parameters:

  wrap_mode | A Gtk::WrapMode.

Glib::SignalProxy0<void> Gtk::TextView::signal_copy_clipboard | ( |  | ) |

Prototype:
  `void copy_clipboard()`

Glib::SignalProxy0<void> Gtk::TextView::signal_cut_clipboard | ( |  | ) |

Prototype:
  `void cut_clipboard()`

Glib::SignalProxy2<void,DeleteType,int> Gtk::TextView::signal_delete_from_cursor | ( |  | ) |

Prototype:
  `void delete_from_cursor(DeleteType type, int count)`

Glib::SignalProxy1<void,const Glib::ustring&> Gtk::TextView::signal_insert_at_cursor | ( |  | ) |

Prototype:
  `void insert_at_cursor(const Glib::ustring& str)`

Glib::SignalProxy3<void,MovementStep,int,bool> Gtk::TextView::signal_move_cursor | ( |  | ) |

Prototype:
  `void move_cursor(MovementStep step, int count, bool extend_selection)`

Glib::SignalProxy1<void,DirectionType> Gtk::TextView::signal_move_focus | ( |  | ) |

Prototype:
  `void move_focus(DirectionType direction)`

Glib::SignalProxy2<void,int,bool> Gtk::TextView::signal_page_horizontally | ( |  | ) |

Prototype:
  `void page_horizontally(int count, bool extend_selection)`

Glib::SignalProxy0<void> Gtk::TextView::signal_paste_clipboard | ( |  | ) |

Prototype:
  `void paste_clipboard()`

Glib::SignalProxy1<void,Menu*> Gtk::TextView::signal_populate_popup | ( |  | ) |

Prototype:
  `void populate_popup(Menu* menu)`

Glib::SignalProxy0<void> Gtk::TextView::signal_set_anchor | ( |  | ) |

Prototype:
  `void set_anchor()`

Glib::SignalProxy2<void,Adjustment*,Adjustment*> Gtk::TextView::signal_set_scroll_adjustments | ( |  | ) |

Prototype:
  `void set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment)`

Glib::SignalProxy0<void> Gtk::TextView::signal_toggle_overwrite | ( |  | ) |

Prototype:
  `void toggle_overwrite()`

bool Gtk::TextView::starts_display_line | ( | const TextBuffer::iterator& | 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 Gtk::TextIter.

Returns:
  `true` if iter begins a wrapped line.

void Gtk::TextView::window_to_buffer_coords | ( | TextWindowType | win,
|  | int | window_x,
|  | int | window_y,
|  | int& | buffer_x,
|  | int& | buffer_y
| ) |

Converts coordinates on the window identified by win to buffer coordinates, storing the result in ( buffer_x , buffer_y ).

Note that you can't convert coordinates for a nonexisting window (see set_border_window_size()).

Parameters:

  win | A Gtk::TextWindowType except Gtk::TEXT_WINDOW_PRIVATE.
  window_x | Window x coordinate.
  window_y | Window y coordinate.
  buffer_x | Buffer x coordinate return location.
  buffer_y | Buffer y coordinate return location.

## Friends And Related Function Documentation

Gtk::TextView* wrap | ( | GtkTextView* | object,
|  | bool | take_copy = false
| ) | `[related]`

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

- textview.h