| 1 | [comment {-*- tcl -*- doctools manpage}] |
|---|
| 2 | [manpage_begin autoscroll n 1.1] |
|---|
| 3 | [moddesc {Automatic mapping of scrollbars}] |
|---|
| 4 | [titledesc {Provides for a scrollbar to automatically mapped and unmapped as needed}] |
|---|
| 5 | [require Tcl] |
|---|
| 6 | [require autoscroll [opt 1.1]] |
|---|
| 7 | [description] |
|---|
| 8 | |
|---|
| 9 | This package allows scrollbars to be mapped and |
|---|
| 10 | unmapped as needed depending on the size and |
|---|
| 11 | content of the scrollbars scrolled widget. The |
|---|
| 12 | scrollbar must be managed by either pack or grid, |
|---|
| 13 | other geometry managers are not supported. |
|---|
| 14 | |
|---|
| 15 | [para] |
|---|
| 16 | |
|---|
| 17 | When managed by pack, any geometry changes made in the |
|---|
| 18 | scrollbars parent between the time a scrollbar is |
|---|
| 19 | unmapped, and when it is mapped will be lost. It is |
|---|
| 20 | an error to destroy any of the scrollbars siblings while the |
|---|
| 21 | scrollbar is unmapped. When managed by grid, if anything |
|---|
| 22 | becomes gridded in the same row and column the scrollbar |
|---|
| 23 | occupied it will be replaced by the scrollbar when remapped. |
|---|
| 24 | |
|---|
| 25 | [para] |
|---|
| 26 | |
|---|
| 27 | This package may be used on any scrollbar-like widget |
|---|
| 28 | as long as it supports the [const set] subcommand in the same |
|---|
| 29 | style as scrollbar. If the [const set] subcommand is not used |
|---|
| 30 | then this package will have no effect. |
|---|
| 31 | |
|---|
| 32 | [para] |
|---|
| 33 | |
|---|
| 34 | [list_begin definitions] |
|---|
| 35 | |
|---|
| 36 | [call [cmd ::autoscroll::autoscroll] [arg scrollbar]] |
|---|
| 37 | |
|---|
| 38 | Arranges for the already existing scrollbar [const scrollbar] |
|---|
| 39 | to be mapped and unmapped as needed. |
|---|
| 40 | |
|---|
| 41 | [call [cmd ::autoscroll::unautoscroll] [arg scrollbar]] |
|---|
| 42 | |
|---|
| 43 | Returns the named scrollbar to its original static state. |
|---|
| 44 | |
|---|
| 45 | [call [cmd ::autoscroll::wrap]] |
|---|
| 46 | |
|---|
| 47 | Arranges for all scrollbars created after this command is run |
|---|
| 48 | to be automatically mapped and unmapped as needed. |
|---|
| 49 | |
|---|
| 50 | [call [cmd ::autoscroll::unwrap]] |
|---|
| 51 | |
|---|
| 52 | Turns off the automatic autoscrolling of all new scrollbars. |
|---|
| 53 | Does not effect existing scrollbars |
|---|
| 54 | |
|---|
| 55 | [list_end] |
|---|
| 56 | |
|---|
| 57 | [example { |
|---|
| 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 | |
|---|
| 65 | |
|---|
| 66 | [keywords scroll scrollbar] |
|---|
| 67 | [manpage_end] |
|---|