yview

This command is used to query and change the vertical position of the text in the widget's window. It can take any of the following forms:

(#<widget> 'yview)
Returns a list containing two elements, both of which are real fractions between 0 and 1. The first element gives the position of the first character in the top line in the window, relative to the text as a whole (0.5 means it is halfway through the text, for example). The second element gives the position of the character just after the last one in the bottom line of the window, relative to the text as a whole. These are the same values passed to scrollbars via the #:yscrollcommand option.
(#<widget> 'yview 'moveto fraction)
Adjusts the view in the window so that the character given by fraction appears on the top line of the window. Fraction is a fraction between 0 and 1; 0 indicates the first character in the text, 0.33 indicates the character one-third the way through the text, and so on.
(#<widget> 'yview 'scroll number what)
This command adjust the view in the window up or down according to number and what. Number must be an integer. What must be either units or pages. If what is units, the view adjusts up or down by number lines on the display; if it is pages then the view adjusts by number screenfuls. If number is negative then earlier positions in the text become visible; if it is positive then later positions in the text become visible.
(#<widget> 'yview ?#:pickplace? index)
Changes the view in the widget's window to make index visible. If the #:pickplace option isn't specified then index will appear at the top of the window. If #:pickplace is specified then the widget chooses where index appears in the window:
  1. If index is already visible somewhere in the window then the command does nothing.
  2. If index is only a few lines off-screen above the window then it will be positioned at the top of the window.
  3. If index is only a few lines off-screen below the window then it will be positioned at the bottom of the window.
  4. Otherwise, index will be centered in the window.

The #:pickplace option has been obsoleted by the see widget command (see handles both x- and y-motion to make a location visible, whereas #:pickplace only handles motion in y).

(#<widget> 'yview number)
This command makes the first character on the line after the one given by number visible at the top of the window. Number must be an integer. This command used to be used for scrolling, but now it is obsolete.

© Author | Home | Sitemap