NAME
CAD::Drawing::IO::Tk -- GUI I/O methods for CAD::Drawing
NOTICE
This module is considered extremely pre-ALPHA and its use is probably deprecated by the time you read this.
AUTHOR
Eric L. Wilhelm
ewilhelm at sbcglobal dot net
http://pages.sbcglobal.net/mycroft
COPYRIGHT
This module is copyright (C) 2003 by Eric L. Wilhelm and A. Zahner Co.
LICENSE
This module is distributed under the same terms as Perl. See the Perl source package for details.
You may use this software under one of the following licenses:
(1) GNU General Public License
(found at http://www.gnu.org/copyleft/gpl.html)
(2) Artistic License
(found at http://www.perl.com/pub/language/misc/Artistic.html)
NO WARRANTY
This software is distributed with ABSOLUTELY NO WARRANTY. The author and his employer will in no way be held liable for any loss or damages resulting from its use.
Modifications
The source code of this module is made freely available and distributable under the GPL or Artistic License. Modifications to and use of this software must adhere to one of these licenses. Changes to the code should be noted as such and this notification (as well as the above copyright information) must remain intact on all copies of the code.
Additionally, while the author is actively developing this code, notification of any intended changes or extensions would be most helpful in avoiding repeated work for all parties involved. Please contact the author with any such development plans.
SEE ALSO
CAD::Drawing::IO
Tk
Methods
There is no constructor for this class, its methods are inherited via CAD::Drawing::IO
Need to re-structure the entire deal to have its own object which belongs to the drawing object (or does the drawing object belong to this object?) Either way, we need to be able to build-up into interactive commands (possibly using eval("\$drw->$command"); ?)
show
Creates a new window (no options are required.)
$drw->show(%options);
- Available Options
-
forkokay => bool -- Attempt to fork the new window window => MainWindow -- Use the pre-existing Tk object size => [W,H] -- Specify window size in pixels width => W -- alias to size height => H -- ditto center => [X,Y] -- Center the drawing at (X,Y) scale => factor -- Zoom by factor (default to fit) bgcolor => color -- defaults to "white"
Draw
Draws geometry on the Tk canvas $cnv. List of items to draw must be specified via addresses stored in $options{items}.
$drw->Draw($cnv, %options);
tkbindings
Setup the keybindings.
$drw->tkbindings($mw, $cnv);
windowzoom
Creates temporary bindings to drawing a rubber-band box.
windowzoom($cnv);
tksetview
No longer used
$drw->tksetview($cnv, %options);
scalebox
Returns the scaling required to create a view which most closely matches @ext to @size of canvas.
$scale = $drw->scalebox(\@size, \@ext);
tkpoint
Returns only the first and second element of an array reference as a list.
@xy_point = tkpoint(\@pt);
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 102:
'=item' outside of any '=over'
- Around line 207:
You forgot a '=back' before '=head2'