In case you haven't tried out the "widget" demo script that comes with the Tk modules, just run "widget" from a command line, and check out the last item in the "Canvases" section of the demo main window ("8. Tiles and transparent images"); the commentary and sample code provided there should get you started.

You might need to use the "place" geometry manager (perldoc Tk::place), in order to get your canvas to sit on top of other widgets, or maybe the "tile" arrangement shown in the widget demo will suffice.

Binding the mapping/unmapping of the overlay canvas (or tile) to mouse button events should be doable (Tk::bind, Tk::events), but maybe you want to think a little more about how the user is going to control things and make selections from the popup menu. (Will you need to hold the mouse button down while moving it to the object to be selected then release to select, or will consecutive clicks toggle the presence of the overlay canvas and make the selection?)


In reply to Re: Perl/Tk and Transparent Canvases by graff
in thread Perl/Tk and Transparent Canvases by Mikster

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.