CAD::Drawing::IO::Tk

CAD::Drawing::IO::Tk is a Perl module with GUI I/O methods for CAD::Drawing.
Download

CAD::Drawing::IO::Tk Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Eric L. Wilhelm
  • Publisher web site:
  • http://search.cpan.org/~ewilhelm/Date-Piece-v0.0.2/lib/Date/Piece.pm

CAD::Drawing::IO::Tk Tags


CAD::Drawing::IO::Tk Description

CAD::Drawing::IO::Tk is a Perl module with GUI I/O methods for CAD::Drawing. CAD::Drawing::IO::Tk is a Perl module with GUI I/O methods for CAD::Drawing.This module is considered extremely pre-ALPHA and its use is probably deprecated by the time you read this.MethodsThere is no constructor for this class, its methods are inherited via CAD::Drawing::IOThoughtsNeed 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"); ?)Ultimately, the focus here will likely drift toward supporting perlcad and enabling use of perlcad from within CAD::Drawing scripts. However, the nature of lights-out scripting vs the nature of on-screen drafting is quite different, so there will be some tricks involved. Once each entity has its own class, the ability to install callbacks and the resolution of notifications should get easier. But, there will still be the issue that a debug popup does not know it will appear when the entities are created, while a drafting viewport does (or does it?)Possibly, adding a list of tk-id's to each $obj as it is drawn would be a good starting point, but this gets us into trouble with multiple viewports.showCreates 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 stl => Message -- Use pre-existing Message widget size => -- Specify window size in pixels width => W -- alias to size height => H -- ditto center => -- Center the drawing at (X,Y) scale => factor -- Zoom by factor (default to fit) bgcolor => color -- defaults to "white" hang => boolean -- if not, you just get the canvas widget items => @list -- sorry, not compatible with select_addr :(DrawDraws geometry on the Tk canvas $cnv. List of items to draw must be specified via addresses stored in $options{items}.The newest fad (:e) is the $options{tag} argument, which uses addr_to_tktag() to tag the item. $drw->Draw($cnv, %options);tkbindingsSetup the keybindings. $drw->tkbindings($mw, $cnv);text_size_reset text_size_reset($cnv);free_dist free_dist();windowzoomCreates temporary bindings to drawing a rubber-band box. windowzoom($cnv);tksetviewNo longer used $drw->tksetview($cnv, %options);scaleboxReturns the scaling required to create a view which most closely matches @ext to @size of canvas. $scale = $drw->scalebox(@size, @ext);dsp subroutine refseach of these should do everything necessary to draw the item on the canvas (but they might like to have a few options available?) and then return a list of the Tk id's of the created items. Caller will then assign identical tags to each id which is returned by each per-entity call.tkpointReturns only the first and second element of an array reference as a list. @xy_point = tkpoint(@pt);addr_to_tktagReturns a stringified tag of form: ###### my $tag = $drw->addr_to_tktag($addr);tktag_to_addrReturns an anonymous hash reference which should serve as an address, provided that $tag is a valid < layer >###< type >###< id > tag (and that the entity exists in the $drw object (check this yourself.) my $addr = $drw->tktag_to_addr($tag); Requirements: · Perl


CAD::Drawing::IO::Tk Related Software