In my continuing endeveur to create a solitare game in perl (see node PerlSOl (solitare in perl)) I have come across a problem (... er ... another one, anyway).

The question is how does one go about allowing a user to click on a card (a TK::Canvas->createImage type) and drag it about to different places, and then place it down. This presents a plethora of problems (checking if it can go where it is being put, what to do with it if it can't, having some sort of closeenough variable to see if its close enough to pile to count--would canvas -closeenough option be what I want?--etc.).

I think you get the idea. . . now all these things I can play around with and learn from, BUT, in looking for drag/drop procedures in Tk, I found Tk::DragDrop. However, there are 12 module files, all undocumented. I want to know if any one has ever done anything with EITHER this module, or another one that's optionally better, and, if so, can you explain the interface somewhat.

I could go about making my own module to do this, however I'd prefer not to 're-invent the wheel' (and I wouldn't know where to start, and I want to get this done as soon as possible).


In reply to Dragging/Dropping images with Tk by dimmesdale

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.