autoscroll(n)

πŸ“¦
version 0.7 Β· 3 versions
, in alpine 3.24

πŸ¦‹ autoscroll(n) πŸ¦‹

okay bestie, this is the autoscroll(n) manual page β€” the one all about Automatic mapping of scrollbars. it's literally here so your scrollbar can show up and dip out exactly when it's needed. no cap. slay. πŸ’…


πŸ’– NAME πŸ’–

autoscroll β€” provides for a scrollbar to be automatically mapped and unmapped as needed. that's the whole glow-up, fr fr.


✨ SYNOPSIS ✨

package require Tcl

package require autoscroll  ?1.1?

::autoscroll::autoscroll scrollbar

::autoscroll::unautoscroll scrollbar

::autoscroll::wrap

::autoscroll::unwrap

🌸 DESCRIPTION 🌸

This package lets scrollbars be mapped and unmapped as needed, depending on the size and content of the widget that the scrollbar is scrolling. Your scrollbar has to be managed by either pack or grid β€” other geometry managers are not supported, periodt. πŸ’€

🫢 pack bestie check: when a scrollbar is managed by pack, any geometry changes made in the scrollbar's parent between the time the scrollbar is unmapped and when it is mapped will be lost. Also, it is an error to destroy any of the scrollbar's siblings while the scrollbar is unmapped. 😭
🧚 grid bestie check: when a scrollbar is managed by grid, if anything becomes gridded in the same row and column the scrollbar occupied, it will be replaced by the scrollbar when remapped.

This package may be used on any scrollbar-like widget as long as it supports the set subcommand in the same style as scrollbar. If the set subcommand is not used, then this package will have no effect. iykyk.

πŸ› οΈ the commands

  • ::autoscroll::autoscroll scrollbar β€” arranges for the already existing scrollbar scrollbar to be mapped and unmapped as needed. it's giving "existing scrollbar, you're the main character now" energy. πŸ‘‘
  • ::autoscroll::unautoscroll scrollbar β€” returns the named scrollbar to its original static state. lowkey a reset button for the vibe. πŸ’…
  • ::autoscroll::wrap β€” arranges for all scrollbars created after this command is run to be automatically mapped and unmapped as needed. future scrollbars, you're covered. ✨
  • ::autoscroll::unwrap β€” turns off the automatic autoscrolling of all new scrollbars. Does not effect existing scrollbars. (yes, it says "effect" β€” we're preserving the original wording, bestie.) πŸ™ˆ

πŸ“ example time

text .t -yscrollcommand ".scrolly set"
scrollbar .scrolly -orient v -command ".t yview"
pack .scrolly -side right -fill y
pack .t -side left -fill both -expand 1
::autoscroll::autoscroll .scrolly

πŸ› BUGS, IDEAS, FEEDBACK πŸ›

This document, and the package it describes, will undoubtedly contain bugs and other problems. iconic, honestly. Please report such in the category autoscroll of the Tklib Trackers [http://core.tcl.tk/tklib/reportlist]. Please also report any ideas for enhancements you may have for either package and/or documentation. we love a feedback moment. πŸ’Œ


πŸ”‘ KEYWORDS πŸ”‘

scroll, scrollbar


mwah πŸ’‹ β€” this autoscroll(n) page is from tklib, version 1.1. date? not printed here, so we're not inventing one. that's the source/version footer vibe, bestie. 🫢

πŸ“¦ where this page comes from