Curses::Toolkit::Widget::Button - a simple text button widget
version 0.211
The Curses::Toolkit::Widget::Button widget is a classical button widget, used to attach a function that is called when the button is pressed.
This widget cannot hold any widget. If you want a button with a specific widget, please use Curses::Toolkit::Widget::GenericButton, however it may use more space in your interface
Standard theme :
< A Button >
With a border
+----------+ | A Button | +----------+
input : none output : a Curses::Toolkit::Widget::Button
input : the text of the button output : a Curses::Toolkit::Widget::Button
Set the text of the entry
input : STRING, the text output : the button object
Get the text of the Button
input : none output : STRING, the Button text
Given a coordinate representing the available space, returns the space desired The Button desires the minimum size : text length plus the button brackets
input : a Curses::Toolkit::Object::Coordinates object output : a Curses::Toolkit::Object::Coordinates object
Given a coordinate representing the available space, returns the minimum space required The Button requires the text length plus the button brackets
my @signals = keys $button->possible_signals();
returns the possible signals that can be used on ths widget. See Curses::Toolkit::Widget::signal_connect to bind signals to actions
input : none output : HASH, keys are signal names, values are signal classes
To set/get a theme properties, you should do :
$button->set_theme_property(property_name => $property_value); $value = $button->get_theme_property('property_name');
Here is the list of properties related to the window, that can be changed in the associated theme. See the Curses::Toolkit::Theme class used for the default (default class to look at is Curses::Toolkit::Theme::Default)
Don't forget to look at properties from the parent class, as these are also inherited from !
The width of the border of the button.
Example : # set buttons to have a border of 1 $button->set_theme_property(border_width => 1 );
The string to be displayed at the left of the button. Usually some enclosing characters.
Example : # set left enclosing $button->set_theme_property(left_enclosing => '< ' ); $button->set_theme_property(left_enclosing => '[ ' );
The string to be displayed at the right of the button. Usually some enclosing characters.
Example : # set left enclosing $button->set_theme_property(left_enclosing => ' >' ); $button->set_theme_property(left_enclosing => ' ]' );
Damien "dams" Krotkine
This software is copyright (c) 2011 by Damien "dams" Krotkine.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Curses::Toolkit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Curses::Toolkit
CPAN shell
perl -MCPAN -e shell install Curses::Toolkit
For more information on module installation, please visit the detailed CPAN module installation guide.