Curses::UI::Window(3)
β¨ Curses::UI::Window(3) β¨
Okay bestie, so we're looking at the manual page for Curses::UI::Window(3) from the User Contributed Perl Documentation, and it's literally giving main character energy in the widget world π
πΈ NAME πΈ
Curses::UI::Window β create and manipulate Window widgets, periodt. This is the icon, the moment, the window wrapper you didn't know you needed πͺβ¨
π¦ CLASS HIERARCHY π¦
Okay so the vibe check here is that Curses::UI::Window is deep in the family tree. It inherits from Curses::UI::Container, which inherits from Curses::UI::Widget. The way that hierarchy is set up is honestly so organized:
Curses::UI::Widget
|
+----Curses::UI::Container
|
+----Curses::UI::Window
Like, it's giving generational wealth of functionality π§¬π
π SYNOPSIS π
Here's how you bring this baby into existence. No cap, it's this easy:
use Curses::UI;
my $cui = new Curses::UI;
my $win = $cui->add(
'window_id', 'Window',
%options,
);
You literally just use Curses::UI, make a new instance, and then add a Window with whatever %options your heart desires. Slay π
π DESCRIPTION π
So Curses::UI::Window is a window widget β that's the whole assignment. You can add it to a Curses::UI instance, and after that you fill it with other widgets to create an actual application window. It's like the blank canvas of your terminal UI dreams π
For the tea on how to fill the window with widgets, you gotta check out Curses::UI::Container. That's where the details live, bestie.
π STANDARD OPTIONS π
These are the standard options that come with the territory. We're talking:
-parent-x-y-width-height-pad-padleft-padright-padtop-padbottom-ipad-ipadleft-ipadright-ipadtop-ipadbottom-title-titlefullwidth-titlereverse-onfocus-onblur
For an explanation of these standard options, see Curses::UI::Widget. That's the parent manual, okay? It's got the lore π
π WIDGET-SPECIFIC OPTIONS π
So there's this one specific option that makes windows do a cute little trick:
-centered < BOOLEAN >β bestie, this lets a window automatically be drawn in the center of the screen. To enable it, use a true value; to disable it, use a false value. The default is not to center a window. Here's the example so you can see it in action:
$cui->add('mywindow', 'Window', -centered => 1);
It's giving "I want my window right in the middle, looking cute and centered" π π―
π METHODS π
Okay so there are standard methods and then there are the special ones. Let's get into it:
new ( OPTIONS )β standard construction situation.layout ( )β standard layout method.draw ( BOOLEAN )β standard draw method.focus ( )β standard focus method.onFocus ( CODEREF )β standard focus callback situation.onBlur ( CODEREF )β standard blur callback situation.intellidraw ( )β standard intellidraw method.
All of the above are standard methods. See Curses::UI::Widget for the full explanation, because that's where the standard method lore lives π
Now for the modal focus ones:
modalfocus ( )β if you call this method, the window will get modal focus. What does that mean? It means all events will be sent to this window. Like, every single one. It's main character energy to the max. By calling theloose_focusmethod, the window will loose its focus. (Yes, "loose" β that's how it's spelled in the original, we don't fix it, we accept it π)loose_focus ( )β this method will have the window loose its focus. And yes, using this method you can also let a modal focused window loose its focus. So if your window is acting all modal and possessive,loose_focusis the way to free it ποΈ
π₯ SEE ALSO π₯
You already know these are the besties:
Curses::UICurses::UI::ContainerCurses::UI::Widget
Go read those if you want the full picture, iykyk π
π AUTHOR π
Copyright (c) 2001-2002 Maurice Makaay. All rights reserved. That's the original icon right there π«Ά
Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de) β send him some love if this widget serves you well β¨
This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the same terms as perl itself. So like, use it however, just don't come for anyone if it breaks, okay? ππ
Final vibe check: this manual page isperl v5.42.2from2023-07-03, and it's calledCurses::UI::Window(3). We love a classic. Now go build something iconic with your windows, bestie. No cap, you're gonna ate this πβ¨π
π¦ where this page comes from
- alpine 3.24: perl-curses-ui-doc 0.9609-r3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms