![]() |
![]() |
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) |
|
|
|
|
|
|
|
Adds a child widget in the text buffer, at the given anchor .
|
|
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.
|
|
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.
|
|
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.
|
|
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()).
|
|
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.
|
|
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.
|
|
Gets the width of the specified border window.
|
|
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 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.
|
|
Find out whether the cursor is being displayed.
|
|
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 the default editability of the Gtk::TextView. Tags in the buffer may override this setting for some ranges of text.
|
|
Gets the default indentation of paragraphs in text_view . Tags in the view's buffer may override the default. The indentation may be negative.
|
|
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().
|
|
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.
|
|
Gets the default justification of paragraphs in text_view . Tags in the buffer may override the default.
|
|
Gets the default left margin size of paragraphs in the text_view . Tags in the buffer may override the default.
|
|
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-
|
|
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().
|
|
Gets the default number of pixels to put above paragraphs.
|
|
Gets the value set by set_pixels_below_lines().
|
|
Gets the value set by set_pixels_inside_wrap().
|
|
Gets the default right margin for text in text_view . Tags in the buffer may override the default.
|
|
Gets the default tabs for text_view .
Tags in the buffer may override the defaults. The returned array will be
|
|
Fills visible_rect with the currently-visible region of the buffer, in buffer coordinates. Convert to window coordinates with buffer_to_window_coords().
|
|
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
|
|
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
|
|
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
|
|
Gets the line wrapping for the view.
|
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Container. |
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Container. |
|
Updates the position of a child, as for add_child_in_window().
|
|
Moves a mark within the buffer so that it's located within the currently-visible text area.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Moves the cursor to the currently visible region of the buffer, it it isn't there already.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Scrolls text_view the minimum distance such that mark is contained within the visible area of the widget.
|
|
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Sets the default indentation for paragraphs in text_view . Tags in the buffer may override the default.
|
|
Sets the default justification of text in text_view . Tags in the view's buffer may override the default.
|
|
Sets the default left margin for text in text_view . Tags in the buffer may override the default.
|
|
Sets the default number of blank pixels above paragraphs in text_view . Tags in the buffer for text_view may override the defaults.
|
|
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.
|
|
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.
|
|
Sets the default right margin for text in the text view. Tags in the buffer may override the default.
|
|
Sets the default tab stops for paragraphs in text_view . Tags in the buffer may override the default.
|
|
Sets the line wrapping for the view.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Determines whether iter is at the start of a display line. See forward_display_line() for an explanation of display lines vs. paragraphs.
|
|
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()).
|
|
|