Tickit...:Extent(3pm)
β¨ Tickit::Widget::ScrollBox::Extent β¨
okay bestie, welcome to the manpage for Tickit::Widget::ScrollBox::Extent (you'll see it filed under Tickit...:Extent(3pm) in the User Contributed Perl Documentation section π«Ά). she's small, she's cute, she's lowkey iconic, and she holds the receipts on scrolling ranges. let's get into it π
πΈ NAME πΈ
Tickit::Widget::ScrollBox::Extent β she represents the range of scrolling extent. that's the whole job. that's her main character energy. π
π¦ DESCRIPTION π¦
so this tiny little utility object stores the effective scrolling range for a Tickit::Widget::ScrollBox. it's giving "supporting cast member who actually carries the whole plot".
and listen β you do not construct these yourself. nope, no cap. they get returned to you by the hextent and vextent methods of the ScrollBox she's associated with. so she shows up when she's needed, like a true bestie. β¨
π ACCESSORS π
viewport
$viewport = $extent->viewport
returns the size of the viewable portion of the scrollable area β aka the "viewport". it's literally the window you're peeking through. π
total
$total = $extent->total
returns the total size of the scrollable area. and important note bestie: this is always at least the size of the viewport. no exceptions, periodt. π
set_total
$extent->set_total( $total )
sets the total size of the scrollable area. but okay heads up β this method should only be used by the child widget, specifically when it's performing smart scrolling. so don't just roll up and start calling it, that's not your business fr fr. π
limit
$limit = $extent->limit
returns the limit of the offset β meaning the largest value the start offset may be. it's simply $total - $viewport, with a limit applied so that it returns zero rather than a negative value, in the case that the viewport is bigger than the total. so no negative nonsense here, we keep it cute. π
start
$start = $extent->start
returns the start position offset of the viewport within the total area. she is always at least zero, and never greater than the limit. boundaries queen. π
π METHODS π
scroll
$extent->scroll( $delta )
requests to move the start by the amount you give. and if that moves outside the allowed range? it gets clipped. sorry girl, the range said no. π
scroll_to
$extent->scroll_to( $new_start )
requests to move the start to that given value. same deal β if it's outside the allowed range, it gets clipped. no drama, just boundaries. βοΈ
scrollbar_geom
( $bar_top, $mark_top, $mark_bottom, $bar_bottom ) = $extent->scrollbar_geom( $top, $length )
calculates the start and end positions of a scrollbar and the mark within it, so it can represent the position of the extent. returns four integer indexes within $length. four whole values, she's generous like that. π
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk> β the icon, the legend, the moment. π
and that's the whole vibe check bestie, every flag and fact intact, nothing skipped, nothing invented π«Ά
signing off: this was perl v5.36.0, dated 2022-12-17, brought to you by the User Contributed Perl Documentation crew. mwah, slay, bye π πβ¨
π¦ where this page comes from
- debian bookworm: libtickit-widget-scrollbox-perl 0.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtickit-widget-scrollbox-perl 0.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtickit-widget-scrollbox-perl 0.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtickit-widget-scrollbox-perl 0.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtickit-widget-scrollbox-perl 0.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms