Prima::Widget is a window management class.
SYNOPSIS
# create a widget
my $widget = Prima::Widget-> new(
size => [ 200, 200],
color => cl::Green,
visible => 0,
onPaint => sub {
my ($self,$canvas) = @_;
$canvas-> clear;
$canvas-> text_out( "Hello world!", 10, 10);
},
);
# manipulate the widget
$widget-> origin( 10, 10);
$widget-> show;
Prima::Widget is a descendant of Prima::Component, a class, especially crafted to reflect and govern properties of a system-dependent window, such as its position, hierarchy, outlook etc. Prima::Widget is mapped into the screen space as a rectangular area, with distinct boundaries, pointer and sometimes cursor, and a user-selectable input focus.
USAGE
Prima::Widget class and its descendants are used widely throughout the toolkit, and, indeed provide almost all its user interaction and input-output. The notification system, explained in Prima::Object, is employed in Prima::Widget heavily, providing the programmer with unified access to the system-generated events, that occur when the user moves windows, clicks the mouse, types the keyboard, etc. Descendants of Prima::Widget use the internal, the direct method of overriding the notifications, whereas end programs tend to use the toolkit widgets equipped with anonymous subroutines ( see Prima::Object for the details).
The class functionality is much more extensive comparing to the other built-in classes, and therefore the explanations are grouped in several topics.
Product's homepage
Requirements:
· Perl