I have a text widget and am trying to make dragdrop work. What I want to do is be able to select words using the normal <Double-1> binding, but <Shift-3> will invoke a drag of the selected word.

I have an application where this "used to" work, but then a new version of Tk or Tk::Text broke it.

The problem is that <3> is bound to a menu. The real problem is that all combinations of <3> are bound to the menu, so no matter what combination of key modifiers (Shift, Alt, Ctrl, etc.) I press, the text widget "does me the favor" of mapping that to the menu invocation. What I wanted was for Tk::Text to invoke the menu on <3> and *only* on <3>, not on <Shift-3> or <Meta-3> and so on.

My favorite slander of microsoft applies here: "Do me a favor, don't do me any favors". I cannot seem to figure out how to bind the dragdrop motion event to some mouse/key combination.

For grins, I tried to delete the <Shift-3> binding like this:
$text->bind('<Shift-3>');
but this did nothing.

How can I wrest a mouse/key binding back from Tk::Text?

Thanks

P.S. Again, long ago in a galaxy far away this *used* to work. I have a listbox dragdrop example working just fine in the same application so its not like I can't get dragdrop to work at all.


In reply to make drag drop work in text widget by rdsmithaz

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.