Details
enum GtkTextWindowType
typedef enum
{
GTK_TEXT_WINDOW_PRIVATE,
GTK_TEXT_WINDOW_WIDGET,
GTK_TEXT_WINDOW_TEXT,
GTK_TEXT_WINDOW_LEFT,
GTK_TEXT_WINDOW_RIGHT,
GTK_TEXT_WINDOW_TOP,
GTK_TEXT_WINDOW_BOTTOM
} GtkTextWindowType; |
gtk_text_view_new_with_buffer ()
Creates a new GtkTextView widget displaying the buffer
buffer. One buffer can be shared among many widgets.
buffer may be NULL to create a default buffer, in which case
this function is equivalent to gtk_text_view_new(). The
text view adds its own reference count to the buffer; it does not
take over an existing reference.
gtk_text_view_set_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; GtkTextView
will not "adopt" it.
gtk_text_view_get_buffer ()
Returns the GtkTextBuffer 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.
gtk_text_view_scroll_to_mark ()
Scrolls text_view so that mark is on the screen in the position
indicated by xalign and yalign. 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 function is reduced by a margin of size within_margin.
gtk_text_view_scroll_to_iter ()
Scrolls text_view so that iter is on the screen in the position
indicated by xalign and yalign. 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 function is reduced by a margin of size within_margin.
NOTE: This function uses the currently-computed height of the
lines in the text buffer. Note that line heights are computed
in an idle handler; so this function may not have the desired effect
if it's called before the height computations. To avoid oddness,
consider using gtk_text_view_scroll_to_mark() which saves a point
to be scrolled to after line validation.
gtk_text_view_scroll_mark_onscreen ()
Scrolls text_view the minimum distance such that mark is contained
within the visible area of the widget.
gtk_text_view_move_mark_onscreen ()
Moves a mark within the buffer so that it's
located within the currently-visible text area.
gtk_text_view_place_cursor_onscreen ()
Moves the cursor to the currently visible region of the
buffer, it it isn't there already.
gtk_text_view_get_visible_rect ()
Fills visible_rect with the currently-visible
region of the buffer, in buffer coordinates. Convert to window coordinates
with gtk_text_view_buffer_to_window_coords().
gtk_text_view_get_iter_location ()
Gets a rectangle which roughly contains the character at iter.
The rectangle position is in buffer coordinates; use
gtk_text_view_buffer_to_window_coords() to convert these
coordinates to coordinates for one of the windows in the text view.
gtk_text_view_get_line_at_y ()
Gets the GtkTextIter at the start of the line containing
the coordinate y. y is in buffer coordinates, convert from
window coordinates with gtk_text_view_window_to_buffer_coords().
If non-NULL, line_top will be filled with the coordinate of the top
edge of the line.
gtk_text_view_get_line_yrange ()
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 gtk_text_view_buffer_to_window_coords().
gtk_text_view_get_iter_at_location ()
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
gtk_text_view_window_to_buffer_coords().
gtk_text_view_buffer_to_window_coords ()
Converts coordinate (buffer_x, buffer_y) to coordinates for the window
win, and stores the result in (window_x, window_y).
gtk_text_view_window_to_buffer_coords ()
Converts coordinates on the window identified by win to buffer
coordinates, storing the result in (buffer_x,buffer_y).
gtk_text_view_get_window ()
Retrieves the GdkWindow 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 NULL and nonexistent if their width or
height is 0, and are nonexistent before the widget has been
realized.
gtk_text_view_get_window_type ()
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.
gtk_text_view_set_border_window_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.
gtk_text_view_forward_display_line ()
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 GtkTextBuffer.
gtk_text_view_backward_display_line ()
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 GtkTextBuffer.
gtk_text_view_forward_display_line_end ()
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 GtkTextBuffer.
gtk_text_view_backward_display_line_start ()
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 GtkTextBuffer.
gtk_text_view_starts_display_line ()
Determines whether iter is at the start of a display line.
See gtk_text_view_forward_display_line() for an explanation of
display lines vs. paragraphs.
gtk_text_view_move_visually ()
Moves iter up or down by count display (wrapped) lines.
See gtk_text_view_forward_display_line() for an explanation of
display lines vs. paragraphs.
gtk_text_view_add_child_at_anchor ()
Adds a child widget in the text buffer, at the given anchor.
struct GtkTextChildAnchor
struct GtkTextChildAnchor; |
struct GtkTextChildAnchorClass
struct GtkTextChildAnchorClass; |
gtk_text_child_anchor_get_widgets ()
Gets a list of all widgets anchored at this child anchor.
The returned list should be freed with g_list_free().
gtk_text_child_anchor_get_deleted ()
Determines whether a child anchor has been deleted from
the buffer. Keep in mind that the child anchor will be
unreferenced when removed from the buffer, so you need to
hold your own reference (with g_object_ref()) if you plan
to use this function — otherwise all deleted child anchors
will also be finalized.
gtk_text_view_add_child_in_window ()
Adds a child at fixed coordinates in one of the text widget's
windows. The window must have nonzero size (see
gtk_text_view_set_border_window_size()). Note that the child
coordinates are given relative to the GdkWindow 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 gtk_text_view_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.
gtk_text_view_set_wrap_mode ()
Sets the line wrapping for the view.
gtk_text_view_get_wrap_mode ()
Gets the line wrapping for the view.
gtk_text_view_set_editable ()
Sets the default editability of the GtkTextView. You can override
this default setting with tags in the buffer, using the "editable"
attribute of tags.
gtk_text_view_get_editable ()
Returns the default editability of the GtkTextView. Tags in the
buffer may override this setting for some ranges of text.
gtk_text_view_set_cursor_visible ()
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.
gtk_text_view_get_cursor_visible ()
Find out whether the cursor is being displayed.
gtk_text_view_set_pixels_above_lines ()
void gtk_text_view_set_pixels_above_lines
(GtkTextView *text_view,
gint 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.
gtk_text_view_get_pixels_above_lines ()
Gets the default number of pixels to put above paragraphs.
gtk_text_view_set_pixels_below_lines ()
void gtk_text_view_set_pixels_below_lines
(GtkTextView *text_view,
gint 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.
gtk_text_view_set_pixels_inside_wrap ()
void gtk_text_view_set_pixels_inside_wrap
(GtkTextView *text_view,
gint 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.
gtk_text_view_set_justification ()
Sets the default justification of text in text_view.
Tags in the view's buffer may override the default.
gtk_text_view_get_justification ()
Gets the default justification of paragraphs in text_view.
Tags in the buffer may override the default.
gtk_text_view_set_left_margin ()
void gtk_text_view_set_left_margin (GtkTextView *text_view,
gint left_margin); |
Sets the default left margin for text in text_view.
Tags in the buffer may override the default.
gtk_text_view_get_left_margin ()
Gets the default left margin size of paragraphs in the text_view.
Tags in the buffer may override the default.
gtk_text_view_set_right_margin ()
void gtk_text_view_set_right_margin (GtkTextView *text_view,
gint right_margin); |
Sets the default right margin for text in the text view.
Tags in the buffer may override the default.
gtk_text_view_get_right_margin ()
Gets the default right margin for text in text_view. Tags
in the buffer may override the default.
gtk_text_view_set_indent ()
Sets the default indentation for paragraphs in text_view.
Tags in the buffer may override the default.
gtk_text_view_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.
gtk_text_view_set_tabs ()
Sets the default tab stops for paragraphs in text_view.
Tags in the buffer may override the default.
gtk_text_view_get_tabs ()
Gets the default tabs for text_view. Tags in the buffer may
override the defaults. The returned array will be NULL if
"standard" (8-space) tabs are used. Free the return value
with pango_tab_array_free().
gtk_text_view_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_text_iter_get_attributes() in order to get the
attributes in effect at a given text position.
The return value is a copy owned by the caller of this function,
and should be freed.
GTK_TEXT_VIEW_PRIORITY_VALIDATE
#define GTK_TEXT_VIEW_PRIORITY_VALIDATE (GDK_PRIORITY_REDRAW + 5) |
The priority at which the text view validates onscreen lines
in an idle job in the background.