perldough has asked for the wisdom of the Perl Monks concerning the following question:
I want to be able to click anywhere in a Canvas and have the callback subroutine know the ID of the Canvas object (i.e., polygon, text, line) that was immediately under that click. I am currently binding to all canvas objects using the line below.
$canvas->bind('all', '<ButtonPress-3>', [\&callback, $Tk, "menu", Ev(' +x'), Ev('y')]);
Desperately, I tried using Ev('W'), but that returned a reference to the canvas, as I expected. :(
As usual, your wisdom is much appreciated.
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Determine canvas object under click (Tk)
by thundergnat (Deacon) on Aug 14, 2012 at 15:34 UTC | |
|
Re: Determine canvas object under click (Tk)
by zentara (Cardinal) on Aug 14, 2012 at 16:40 UTC | |
by perldough (Sexton) on Aug 15, 2012 at 19:27 UTC |