johnnywang has asked for the wisdom of the Perl Monks concerning the following question:
Hi, please excuse me for the unshameful desire to steal code. Does anyone know of a publicly available simple perl/tk application that does the following (I can assure you that this is not homework, I'm too old for that, but not too old to be lazy:-): provide a canvas for drawing some simple line based diagrams (points, lines, circles), select and move them, save to and load from text file. Preferably I'd like to use GD to plot, and capture the GD elements in the text file (i.e., points and lines). Thanks.
Re: Looking for perl/tk code
by PodMaster (Abbot) on Sep 23, 2004 at 07:35 UTC
|
Its called "widget", also known as Perk/Tk Widget Demonstration.
MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!" | I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README). | ** The third rule of perl club is a statement of fact: pod is sexy. |
| [reply] |
Re: Looking for perl/tk code
by Crian (Curate) on Sep 23, 2004 at 11:36 UTC
|
You could take a look at my graph editor GED. I don't use GD for printing, but the other points are covered, I think. You can find it here:
http://www.duehl.de/christian/perl/ged.html#download
It's a german side, but you will find the download link easily. The program has german comments too, but it's planed to be translated.
You can't steal this code, because it already belongs to you (to all) =)
| [reply] |
|
That's great, exactly what I want. Actually I'm trying to have an app to help me draw geometry pictures, and to include the picture in latex file. Your program does exactly that. Would love to have an english version (ha, I returned the little german I knew to the teachers long time ago.). I see you're exporting latex directly, I was thinking of exporting GD instructions, and generate png with GD, then include the image in latex. Thanks.
| [reply] |
Re: Looking for perl/tk code
by Velaki (Chaplain) on Sep 23, 2004 at 09:53 UTC
|
Another possibility might be to use SVG, Scalable Vector Graphics. If you need GD, there is a SVG::GD module that might be of interest, as well as GD::SVG.
Just an extra thought,
-v
"Perl. There is no substitute."
| [reply] |
Re: Looking for perl/tk code
by zentara (Archbishop) on Sep 23, 2004 at 16:11 UTC
|
Hi, I knew someone had posted something awhile ago like this, but it took me a few hours to remember it. :-) So check out Tk Rubberband Demo. If you combine it with Crian' GED, you would just about have it. If you don't want to deal with ps, you could use the Tk::WinPhoto module Tk Screen and Canvas Screenshots
to output png, and use png2gd to save as gd.
I'm not really a human, but I play one on earth.
flash japh
| [reply] |
|
|