Weaving::Tablet::Tk - Tk user interface to Weaving::Tablet designer
use Weaving::Tablet::Tk; use Tk; my $pattern = Weaving::Tablet::Tk->new_pattern(mw => $mw, file => $file); my $pattern2 = Weaving::Tablet::Tk->new_pattern(mw => $mw, cards => $cards, rows => $rows); $pattern->canvas # get the drawing area $pattern->window # get the toplevel window MainLoop;
Weaving::Tablet::Tk wraps a Tk user interface around the core routines in Weaving::Tablet.
Weaving::Tablet::Tk is a subclass of Weaving::Tablet.
The new function expects arguments as key/value pairs.
The key "mw" is always expected. If not present, a new MainWindow is created. If present, it is the parent for a new Toplevel window.
The key "file" identifies a pattern file to be loaded. If a pattern cannot be loaded from that file, undef is returned.
The keys "cards" and "rows" specify the size of a new, blank pattern.
If the "file" key is not provided, a blank pattern is created, with a default size of 1 row by 1 card.
The window and the drawing canvas are available via member functions.
You can retrieve the Toplevel window via the "window" member. You can retrieve the drawing canvas via the "canvas" member.
Michael Houghton
perl(1).
To install Weaving::Tablet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Weaving::Tablet
CPAN shell
perl -MCPAN -e shell install Weaving::Tablet
For more information on module installation, please visit the detailed CPAN module installation guide.