Tickit...oatBox(3pm)
π Tickit::Widget::FloatBox π
okay bestie, gather round, because this one is so cute and so useful and it's literally called Tickit::Widget::FloatBox (a 3pm manual page, for the record) and it's here to manage a whole lil collection of floating widgets for you. no cap. π¦
β¨ SYNOPSIS β¨
TODO
yes girl, the synopsis is literally just TODO. iconic of the author honestly. moving on π
πΈ DESCRIPTION πΈ
so this container widget is basically the girl who holds everyone's stuff β it keeps a collection of floating widgets, and those floats can be displayed over the top of a single base widget. the box itself? entirely occupied by the base widget. periodt.
and by default β like, when no floats have been created or displayed β it behaves essentially invisibly. it's giving ghost. it's giving "was the box even there??" because it acts as though the box weren't there at all and the base widget was just an immediate child of whatever container the floatbox is sitting inside. sneaky. invisible. slay. π
π CONSTRUCTOR π
new
$floatbox = Tickit::Widget::FloatBox->new( %args )
constructs a brand-new Tickit::Widget::FloatBox object. fresh out the box, literally. β¨
it takes the following named arguments in addition to those taken by the base Tickit::ContainerWidget constructor:
base_child => Tickit::Widgetβ the mainTickit::Widgetinstance to use as the base. π«Ά
β οΈ okay so this argument is now discouraged because it complicates the construction of subclasses. instead, bestie, use the set_base_child method, used as a chaining mutator. trust. π
π ACCESSORS π
base_child / set_base_child
$base_child = $floatbox->base_child
$floatbox->set_base_child( $base_child )
returns or sets the base widget to use. simple as that. π
the mutator method returns the container widget instance itself, which makes it perfect for chaining β like this:
my $container = Tickit::Widget::FloatBox->new( ... )
->set_base_child( Tickit::Widget::Box->new ... );
chain it, queen. π₯
add_float
$float = $floatbox->add_float( %args )
adds a widget as a floating child and hands you back a brand-new Float object. π it takes these arguments:
child => Tickit::Widgetβ the child widget. the actual star of the show.top,bottom,left,right => INTβ the initial geometry of the floating area. these behave exactly the same way as themovemethod on the Float object. same rules, same energy. πhidden => BOOLβ optional. if it's true, the float starts off hidden initally, and you gotta call theshowmethod before it becomes visible. peekaboo, but make it Unix. π
π¦ FLOATS π¦
these are the objects that represent a floating region, as returned by the add_float method. your float babies. π
child
$child = $float->child
returns the child widget in the region. that's it, that's the whole method. πΈ
move
$float->move( %args )
redefines the area geometry of the region. it takes arguments named top, bottom, left and right, and each one should either be a numeric value or undef. π
here's the rules, bestie, listen up:
- the region must have at least one of
toporbottom, and at least one ofleftorrightdefined β that's what fixes the position of one corner of the region. - if the size isn't otherwise determined by the geometry, it will use the preferred size of the child widget.
- any geometry argument may be negative to count backwards from the limits of the parent. counting backwards?? yes. it's giving math but make it fashion. π
for example:
# top-left corner
$float->move( top => 0, left => 0 )
# top-right corner
$float->move( top => 0, right => -1 )
# bottom 3 lines, flush left
$float->move( left => 0, top => -3, bottom => -1 )
any arguments you don't pass will be left unchanged. and if you specifically wanna clear the current value? pass a value of undef. periodt. β
remove
$float->remove
removes the float from the FloatBox. bye bestie, it was real. π
hide
$float->hide
hides the float by hiding the window of its child widget. so the child's window is what actually dips out. π«₯
show
$float->show
shows the float by showing the window of its child widget. this is the undo of hide β undoes the effect of hide, exactly. back from the dead, iconic. β¨
is_visible
$visible = $float->is_visible
returns true if the float is currently visible. vibe check on your float. π
π TODO π
things on the to-do list, in list form:
- support adjusting stacking order of floats. (one day. we believe. π)
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk>
and that's the whole page, bestie!! π this one's perl v5.36.0, dated 2022-12-17, and it lives under User Contributed Perl Documentation. go forth and float. ππ¦πΈ
π¦ where this page comes from
- debian bookworm: libtickit-widget-floatbox-perl 0.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtickit-widget-floatbox-perl 0.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtickit-widget-floatbox-perl 0.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtickit-widget-floatbox-perl 0.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtickit-widget-floatbox-perl 0.11-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