Tickit...:Extent(3pm)

πŸ“¦
version 0.12 Β· 2 versions
  • 0.12 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.12 Β· alpine 3.24
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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