Package: gtk

Function gtk-text-view-scroll-to-iter

Lambda List

gtk-text-view-scroll-to-iter (view iter &key margin xalign yalign)

Arguments

view -- a gtk-text-view widget
iter -- a gtk-text-iter iterator
margin -- a double float margin as a [0.0, 0.5) fraction of screen size
xalign -- a double float with the horizontal alignment of the mark within visible area
yalign -- a double float with the vertical alignment of the mark within visible area

Return Value

True if scrolling occurred.

Details

Scrolls the text view so that the iterator is on the screen in the position indicated by the xalign and yalign arguments. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If you do not pass a value for the xalign and yalign arguments, the text scrolls the minimal distance to get the iterator onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size margin.

Note that this function uses the currently computed height of the lines in the text buffer. Line heights are computed in an idle handler. So this function may not have the desired effect if it is called before the height computations. To avoid oddness, consider using the gtk-text-view-scroll-to-mark function which saves a point to be scrolled to after line validation.

Note

The double float arguments take any number, which is coerced to a double float.
 

See also

2021-10-16