Widget(3pm)

πŸ“¦ version 2.1.1, in arch rolling

πŸ’… 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 (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