listbox yview
Reads or changes the vertical view of the items.
PATHNAME yview
PATHNAME yview INDEX
PATHNAME yview moveto FRACTION
PATHNAME yview scroll N WHAT
Description
With no argument, gives two fractions: the first and the last visible part of the list, from 0 to 1. With INDEX, shows that item at the top. moveto shows the list from FRACTION. scroll moves the view by N units (items), N pages (heights of the listbox), or N pixels, as a trackpad does. A scrollbar calls these forms with its -command.
Returns
Two fractions with no argument, else an empty string.
Examples
% listbox .yv -height 4
> pack .yv
> .yv insert end a b c d e f g h
> update
> .yv yview
0.0 0.5
% listbox .yv2 -height 4
> pack .yv2
> .yv2 insert end a b c d e f g h
> update
> .yv2 yview moveto 0.5
> .yv2 yview
0.5 1.0
Errors
% listbox .yv3; .yv3 yview bogus
bad listbox index "bogus": must be active, anchor, end, @x,y, or a number
-errorcode NONE
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1