yes.
you need to know how to draw something (easy, see the Tk::Canvas pod),
and you need to know how to bind mouse events (also relatively easy, see the Tk::bind pod).
Once you get a mouse down event, you should also get a pair of xy coordinates, and that'd be your x1,y1 for whatever you're drawing.
Every time the mouse moves, you should get a pair of xy coordinates, which will be your x2,y2 for whatever you're drawing.
That's all easy to do, the only thing to look out for is memory leaks. Be sure to resize whatever you're drawing, cause you don't wanna create a hundred and 20 of whatever you're drawing (you can, but then you'd have to delete all the old ones, it's just easier to resize).
If you've created a tk app before (at least a basic one), it should take you about an 1-2 hours to get this done (i could do it in half an hour, but i'd need perl to do it ;).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.