1autoscroll(n) Automatic mapping of scrollbars autoscroll(n)
2
3
4
5______________________________________________________________________________
6
8 autoscroll - Provides for a scrollbar to automatically mapped and un‐
9 mapped as needed
10
12 package require Tcl
13
14 package require autoscroll ?1.1?
15
16 ::autoscroll::autoscroll scrollbar
17
18 ::autoscroll::unautoscroll scrollbar
19
20 ::autoscroll::wrap
21
22 ::autoscroll::unwrap
23
24______________________________________________________________________________
25
27 This package allows scrollbars to be mapped and unmapped as needed de‐
28 pending on the size and content of the scrollbars scrolled widget. The
29 scrollbar must be managed by either pack or grid, other geometry man‐
30 agers are not supported.
31
32 When managed by pack, any geometry changes made in the scrollbars par‐
33 ent between the time a scrollbar is unmapped, and when it is mapped
34 will be lost. It is an error to destroy any of the scrollbars siblings
35 while the scrollbar is unmapped. When managed by grid, if anything be‐
36 comes gridded in the same row and column the scrollbar occupied it will
37 be replaced by the scrollbar when remapped.
38
39 This package may be used on any scrollbar-like widget as long as it
40 supports the set subcommand in the same style as scrollbar. If the set
41 subcommand is not used then this package will have no effect.
42
43 ::autoscroll::autoscroll scrollbar
44 Arranges for the already existing scrollbar scrollbar to be
45 mapped and unmapped as needed.
46
47 ::autoscroll::unautoscroll scrollbar
48 Returns the named scrollbar to its original static state.
49
50 ::autoscroll::wrap
51 Arranges for all scrollbars created after this command is run to
52 be automatically mapped and unmapped as needed.
53
54 ::autoscroll::unwrap
55 Turns off the automatic autoscrolling of all new scrollbars.
56 Does not effect existing scrollbars
57
58 text .t -yscrollcommand ".scrolly set"
59 scrollbar .scrolly -orient v -command ".t yview"
60 pack .scrolly -side right -fill y
61 pack .t -side left -fill both -expand 1
62 ::autoscroll::autoscroll .scrolly
63
64
66 scroll, scrollbar
67
68
69
70autoscroll 1.1 autoscroll(n)