Create and manipulate checkbox widgets
Version 1.11
Curses::UI::Widget | +----Curses::UI::Container | +----Curses::UI::Checkbox
use Curses::UI; my $cui = new Curses::UI; my $win = $cui->add('window_id', 'Window');
my $checkbox = $win->add( 'mycheckbox', 'Checkbox', -label => 'Say hello to the world', -checked => 1, );
$checkbox->focus(); my $checked = $checkbox->get();
Curses::UI::Checkbox provides a checkbox widget.
A checkbox is a control for a boolean value (an on/off toggle). It consists of a box which will either be empty (indicating off or false) or contain an \*(C`X\*(C' (indicating on or true). Following this is a text label which described the value being controlled.
[X] This checkbox is on/true/checked/selected [ ] This checkbox is off/false/unchecked/deselected
See exampes/demo-Curses::UI::Checkbox in the distribution for a short demo.
-x -y -width -height -pad -padleft -padright -padtop -padbottom -ipad -ipadleft -ipadright -ipadtop -ipadbottom -title -titlefullwidth -titlereverse -onfocus -onblur -parent
See Curses::UI::Widget for an explanation of these.
Sets the initial label for the checkbox widget to the passed string or value.
Takes a boolean argument. Determines if the widget's initial state is checked or unchecked. The default is false (unchecked).
Expects a coderef and sets it as a callback for the widget. When the checkbox's state is changed, the given code will be executed.
layout draw intellidraw focus onFocus onBlur
See Curses::UI::Widget for an explanation of these.
Returns the current state of the checkbox (0 == unchecked, 1 == checked).
Sets the checkbox to \*(L"checked\*(R".
Sets the checkbox to \*(L"unchecked\*(R".
Flip-flops the checkbox to its \*(L"other\*(R" state. If the checkbox is unchecked then it will become checked, and vice versa.
This method can be used to set the \*(C`-onchange\*(C' event handler (see above) after initialization of the checkbox. It expects a coderef as its argument.
Call the 'loose-focus' routine, causing the widget to lose focus. Call the \*(L"toggle\*(R" method. Call the \*(L"uncheck\*(R" method. Call the \*(L"check\*(R" method.
Curses::UI, Curses::UI::Widget, Curses::UI::Common
Shawn Boyette \*(C`<[email protected]>\*(C'
Copyright 2001-2002 Maurice Makaay; 2003-2006 Marcus Thiesen; 2007 Shawn Boyette. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This package is free software and is provided \*(L"as is\*(R" without express or implied warranty. It may be used, redistributed and/or modified under the same terms as perl itself.