term::interact::pager(3tcl)
π term::interact::pager π
okay bestie, so this is a page from the Tcllib docs, living in the Terminal control section of the manual, and it's all about term::interact::pager β a whole lil terminal widget that pages text for you. let's get into it π«Ά
β¨ NAME β¨
term::interact::pager β it's a terminal widget, and it pages. that's the whole vibe. π
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require term::interact::pager ?0.2?
term::interact::pager object text ?options...?
object interact
object done
object clear
object text text
object configure
object configure option
object configure option value...
object cget option
β¨ DESCRIPTION β¨
so this package hands you a class for making a simple paging text display. that's it, that's the job. iconic, honestly. π
β¨ CLASS API β¨
the package exports exactly one command β the class command β and that's what lets you create pager instances. here's its API:
term::interact::pager object text ?options...?β this creates a brand new pager object named object, initializes it, and returns the fully qualified name of the object command as its result. the argument is the text to show, and after that you can optionally drop configuration options and their values. those options are explained down in the Configuration section, bestie. π
β¨ OBJECT API β¨
the objects that the class command creates give you all these methods:
object interactβ shows the pager on screen at the configured location and starts interacting with it. heads up: this opens its own event loop for processing incoming characters, so it's giving main character energy. the method returns once the interaction has completed. go check the Interaction section for what can actually happen. π¦object doneβ a method for user supplied actions to terminate the interaction with the object. bye bestie πobject clearβ a method for user supplied actions to remove the pager from the terminal. poof, gone, no trace π¨object text textβ use this to change the text shown by the pager. and yes, the pager will reset the dispay to show the first line of the text at the top. (that spelling is literally in the original, don't come for me π)object configureobject configure optionobject configure option value...object cget optionβ standard methods to retrieve and configure the options of the pager. the usual suspects, periodt. β¨
β¨ CONFIGURATION β¨
a pager instance recognizes these options, no cap:
-in chanβ specifies the channel to read character sequences from. defaults tostdin.-out chanβ specifies the channel to write the pager contents to. defaults tostdout.-column intβ specifies the column of the terminal where the left margin of the pager display should appear. defaults to0, i.e. the left-most column.-line intβ specifies the line of the terminal where the top margin of the pager display should appear. defaults to0, i.e. the top-most line.-height intβ specifies the number of lines of text to show at most in the display. defaults to25.-actions dictβ specifies a dictionary containing additional actions, using character sequences as keys. β οΈ note that these sequences cannot override the hardwired sequences described in the Interaction section. the defaults stay undefeated, fr fr. π
β¨ INTERACTION β¨
a pager object recognizes the control sequences below and acts as described. you can supply more control sequences to act on via the configuration, but you are not able to overide these defaults. (again, that spelling is the original's, love her π)
- Cursor Up β the text is scrolled down a single line, making one more line visible at the top. the pager will not react if the first line of the text is already shown. β¬οΈ
- Cursor Down β the text is scrolled up a single line, making one more line visible at the bottom. the pager will not react if the last line of the text is already shown. β¬οΈ
- Page Up β the text is scrolled down a page. the pager will not react if the first line of the text is already shown. π
- Page Down β the text is scrolled up a page. the pager will not react if the last line of the text is already shown. π
- Enter/Return β the interaction with the object is terminated. that's the exit, slay. π
β¨ BUGS, IDEAS, FEEDBACK β¨
ngl, this document and the package it describes will undoubtedly contain bugs and other problems. π please report those in the category term of the Tcllib Trackers: http://core.tcl.tk/tcllib/reportlist. and please also report any ideas for enhancements you may have for either the package and/or the documentation β we want all of it, bestie. π
when proposing code changes, please provide unified diffs, i.e. the output of diff -u.
also note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. do it that way, trust. β¨
β¨ KEYWORDS β¨
control, pager, terminal, text display πΈ
β¨ CATEGORY β¨
Terminal control π₯οΈ
β¨ COPYRIGHT β¨
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page, babe π«Ά this was tcllib, version 0.2, and it's the term::interact::pager(3tcl) manpage β go page some text and have the best day, mwah πβ¨π
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2006 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms