Widget(3pm)
π Widget(3pm) β Lire::UI::Widget
ok so this is a page from LogReport's Lire Documentation and honestly? it's kind of a serve. it's called Widget(3pm), it lives in the Lire::UI::Widget namespace, and it's all about making cute little curses widgets that edit config values. bestie, let me walk you through it π«Ά
β¨ NAME β¨
Lire::UI::Widget β literally just Views for Lire::Config::Value object. that's the whole vibe π
π¦ SYNOPSIS π¦
ok so here's how you actually use it, copy this exactly pls:
use Curses::UI;
use Lire::Config;
Lire::Config->init();
my $ui = new Curses::UI();
my $window = $ui->add( 'window', 'Window' );
my $widget = $window->add( 'widget', 'Lire::UI::Widget',
'value' => Lire::Config->get_var( 'name' ));
look at her go π she's building a whole UI out here
πΈ DESCRIPTION πΈ
Lire::UI::Widget defines Curses::UI::Widget subclasses that you can use to edit Lire::Config::Value object. that's the whole point, no cap.
π new( %args, 'value' => $value, [ onvaluechanged => $handler ] )
so new() is actually a factory method (iconic behavior honestly) β it instantiates the proper Lire::UI::Widget subclass based on the type of the Lire::Config::Value $value. like, it just knows what you need. main character energy π₯
and onvaluechanged is an event that gets trigger whenever the Lire::Config::Value is modified by the user. (yes, the page says "trigger", we keep it, we don't fix it, that's the lore π)
π value()
Returns the Lire::Config::Value object which is edited by this view. simple. gorgeous. slay.
π§ onValueChanded( $code )
Changes the event handler connected to the 'onvaluechanged' event. This event is trigger whenever the Lire::Config::Value associated to this widget is modified. (again β the method name is onValueChanded, and yes there's a little typo in the source, we're preserving it out of respect π)
β refresh_view()
This method can be called to update the view to reflect modifications to the underlying Lire::COnfig::Value. note the capital O in COnfig β that's how the original rolls, we don't touch it, we just point at it lovingly π
π SEE ALSO π
go read those too, iykyk π¦
π VERSION π
$Id: Widget.pm,v 1.27 2006/07/23 13:16:32 vanbaal Exp $
that's the version string, verbatim, don't ask questions π
π AUTHORS π
Francis J. Lacoste <flacoste@logreport.org>Wolfgang Sourdeau <wolfgang@logreport.org>
two legends fr fr π«Ά
π COPYRIGHT π
Copyright (C) 2004 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. (yes this part is shouty, it's a legal thing, respect it π€)
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.
ok that's the whole thing, every option and line accounted for, nothing skipped, we ate and left no crumbs π½οΈβ¨
and finally β cute sign-off time π this page is from Lire 2.1.1, dated 2025-09-28, and it's Widget(3pm) forever and always. mwah π
π¦ where this page comes from
- arch rolling: lire 2.1.1-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms