Tickit...::Item(3pm)
โจ Tickit::Widget::Scroller::Item ๐
okay bestie, so this is the User Contributed Perl Documentation page for Tickit::Widget::Scroller::Item, and honestly? it's giving interface royalty. pull up a chair ๐ซถ
๐ธ NAME ๐ธ
Tickit::Widget::Scroller::Item โ the interface for renderable scroller items, no cap ๐
๐ฆ DESCRIPTION ๐ฆ
So here's the tea, bestie: if you wanna add items to a Tickit::Widget::Scroller, those items have got to follow the interface documented right here. That's the whole vibe. Not optional. It's the contract, and the contract ate. ๐
๐ METHODS ๐
โจ height_for_width โจ
$height = $item->height_for_width( $width )
She tells you how many screen lines the item would take up if you rendered it at that given width. That's it. That's the method. predictive queen behavior ๐ฎ
๐
render ๐
$item->render( $rb, %args )
Renders the item onto the given Tickit::RenderBuffer. and %args? bestie, %args is bringing the following keys to the function ๐
firstline => INT,lastline => INTโ these are the inclusive bounds of the line numbers you're rendering. and listen: if they don't cover the entire height of the item, that lowkey means clipping is about to happen, so the item only needs to draw the lines that were indicated. no need to do extra credit. ๐
ngl, these two are passed along for informational purposes only. Item implementations are totally free to ignore them if they want to, because the clipping itself gets performed by the RenderBuffer. it's handled. chill. ๐
top => INTโ the line of$rcto consider as the top of the item. this one is passed for legacy purposes and will always be zero, fr fr. Item implementations are free to ignore this value too, because it's now performed using thetranslatefacility of the RenderBuffer. the way that legacy parameter is just... sitting there being zero ๐ญ iconic honestly.width => INT,height => INTโ the width in columns and the height in lines to render the item. these correspond to the most recent call toheight_for_width, and they're passed in for consistency and convenience of the item's render method. and important bestie: this is given as the full dimensions of the item, which may be bigger than the subset of lines requested by thefirstlineandlastlineparameters. so don't get it twisted โ full dimensions means full dimensions. ๐โจ
๐ AUTHOR ๐
Paul Evans <leonerd@leonerd.org.uk> โ the icon, the legend, the moment. ๐
okay and for the cute sign-off: this little masterpiece is running on perl v5.38.2, dated 2024-08-10, and it lives its best life as part of the Tickit::Widget::Scroller::Item(3pm) manual. go render something gorgeous, bestie ๐ฆ๐ธ๐ periodt.
๐ฆ where this page comes from
- debian trixie: libtickit-widget-scroller-perl 0.33-1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtickit-widget-scroller-perl 0.33-1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtickit-widget-scroller-perl 0.33-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