Curses::Toolkit::Theme - base class for widgets themes
version 0.211
Base class for widgets themes
None, this is an abstract class
$theme->set_property('Toolkit::Curses::Widget::Class', 'property name', 'value'); $widget->set_property('Toolkit::Curses::Widget::Class', { name1 => 'value1', ... });
Sets a single property or a whole group of property
Properties are arbitrary caracteristics of widgets. For themes, they are grouped by Widgets class name. The property will be set for all widgets from this class using the theme. To set a property, you need to specify the class name of the widget you want to theme , then the property name, then the value name. However you can specify the class name, and a hash representing multiple names / values
Returns the widget.
my $value = $widget->get_property('Toolkit::Curses::Widget::Class', 'property name'); my $hash = $widget->get_property('Toolkit::Curses::Widget::Class');
Return the theme property or the hash of properties of a widget.
my $widget = $theme_instance->get_widget();
Returns the widget of this theme instance, or undef
my $widget = $theme_instance->get_window();
Returns the window of this theme instance, or void
my $widget = $theme_instance->get_root_window();
Returns the root window of this theme instance, or void
my $widget = $theme_instance->get_shape();
Returns the shape of the root window of this theme instance, or void
my $coordinates = $theme_instance->is_in_shape( $coordinate ); my $coordinates = $theme_instance->is_in_shape( x1 => 1, y1 => 1, x2 => 25, y2 => 10 ); my $coordinates = $theme_instance->is_in_shape( x1 => 1, y1 => 1, width => 4, height => 1 );
Returns true / false if the given coordinates are in the current shape. Or returns void if there is no root window.
my $coordinates = $theme_instance->restrict_to_shape( $coordinate ); my $coordinates = $theme_instance->restrict_to_shape( x1 => 1, y1 => 1, x2 => 25, y2 => 10 ); my $coordinates = $theme_instance->restrict_to_shape( x1 => 1, y1 => 1, width => 4, height => 1 );
Given a coordinates, returns it restricted to the shape of the root window, or void if there is no root window. Useful to draw text / line and make sure thay are in the shape
my $curses_object = $theme_instance->curses($attr);
Returns the Curses object. $attr is an optional HASHREF that can contain these keys:
bold : set bold on / off reverse : set reverse on / off focused : draw in focused mode clicked : draw in clicked mode
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.