Tk::Pane(3)
π Tk::Pane β a window panner, bestie
okay so this is Tk::Pane, from the perl/Tk docs, and it's genuinely one of those widgets that just works. It gives you a scrollable frame. That's it. That's the vibe. Once you've created it you can treat it exactly like a normal frame β except, you know, the scrolling part. β¨
π SYNOPSIS
use Tk::Pane;
$pane = $mw->Scrolled("Pane", Name => 'fred',
-scrollbars => 'soe',
-sticky => 'we',
-gridded => 'y'
);
$pane->Frame;
$pane->pack;
like. look at that. name it fred, stick it, grid it, pack it, done. main character energy fr fr π«Ά
πΈ DESCRIPTION
Tk::Pane hands you a scrollable frame widget. Once it's created you can treat it as a frame β the only glow-up is that it's scrollable. no cap, that's the whole deal. π¦
β¨ OPTIONS β¨
-gridded => directionβ tells the pane whether the top and left edges should snap to a grid column. heads up: this option is only useful if the widgets inside the pane are managed by the grid geometry manager. possible values arex,yandxy. π-sticky => styleβ if the Pane ends up bigger than its requested dimensions, this is what positions (or stretches) the slave inside its cavity.styleis a string with zero or more of the charactersn,s,eorw. it can optionally contain spaces or commas, but those are literally ignored, don't worry about it. each letter refers to a side β north, south, east, west β and that's the side your slave will "stick" to. and if you give bothnands(or botheandw), the slave gets stretched to fill the entire height (or width) of its cavity. slay. π₯
π METHODS
π $pane->see($widget ?,options?)
adjusts the view so that $widget is visible. you can pass extra parameters in option-value pairs, and every option-value pair has to be one of these:
-anchor => anchor
specifies how to make the widget visible. if you don't give it, then as much of the widget as possible gets made visible. π
possible values are n, s, w, e, nw, ne, sw and se. this makes an edge on the widget line up with the corresponding edge on the pane β for example nw puts the top left of the widget at the top left of the pane. s puts the bottom of the widget at the bottom of the pane, and makes as much of the widget as possible visible in the x direction. iykyk. π
π¦ $pane->xview
returns a list of two elements, both of them real fractions between 0 and 1. the first element = the position of the left of the window relative to the Pane as a whole (0.5 means it's halfway through the Pane, for example). the second element = the position of the right of the window relative to the Pane as a whole. π
π¦ $pane->xview($widget)
adjusts the view in the window so that $widget is displayed at the left of the window.
π¦ $pane->xview(moveto => fraction)
adjusts the view in the window so that fraction of the total width of the Pane is off-screen to the left. fraction must be a fraction between 0 and 1. β
π¦ $pane->xview(scroll => number, what)
this one shifts the view in the window left or right, according to number and what. number must be an integer. what must be either units or pages, or an abbreviation of one of those. if what is units, the view adjusts left or right by number*10 screen units on the display; if it's pages then the view adjusts by number screenfuls. if number is negative then widgets farther to the left become visible; if it's positive then widgets farther to the right become visible. π
πΈ $pane->yview
returns a list of two elements, both real fractions between 0 and 1. first element = the position of the top of the window relative to the Pane as a whole (0.5 means it's halfway through the Pane, for example). second element = the position of the bottom of the window relative to the Pane as a whole. π
πΈ $pane->yview($widget)
adjusts the view in the window so that $widget is displayed at the top of the window.
πΈ $pane->yview(moveto => fraction)
adjusts the view in the window so that fraction of the total width of the Pane is off-screen to the top. fraction must be a fraction between 0 and 1. β
πΈ $pane->yview(scroll => number, what)
shifts the view in the window up or down according to number and what. number must be an integer. what must be either units or pages, or an abbreviation of one of those. if what is units, the view adjusts up or down by number*10 screen units on the display; if it's pages then the view adjusts by number screenfuls. if number is negative then widgets farther up become visible; if it's positive then widgets farther down become visible. π
yes, the yview(moveto) one says "total widthβ¦ off-screen to the top" β that's exactly what the page says, bestie, i'm not gonna gaslight you and pretend otherwise. π
π«Ά AUTHOR
Graham Barr <gbarr@pobox.com> β icon, legend, the moment. π
π COPYRIGHT
Copyright (c) 1997-1998 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole thing!! π this little beauty is from Tk804.036, dated 2025-07-31, and it's Tk::Pane(3) all day long. go scroll something iconic. π
β¨
π¦ where this page comes from
- alpine 3.23: perl-tk-doc 804.036-r8 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- alpine 3.24: perl-tk-doc 804.036-r8 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms