|laziness, impatience, and hubris|
Re^2: Tk ASCII Draw on Canvasby Discipulus (Abbot)
|on Jun 04, 2019 at 07:49 UTC||Need Help??|
Thanks choroba for looking at my code.
> Canvas is designed to make moving objects around with a mouse easy. Therefore, when you press a button and start moving the mouse, the current is the canvas object that you're moving, i.e. it doesn't change as you move the mouse pointer over the grid.
The above seems very reasonable but i doubt is true: infact, if true, how can my code work? I currently have:
$canvas->Tk::bind("<Control-Motion>", [ \&set_coord, Ev('x'), Ev('y') ]);
and this code actually draws on the canvas and the element tagged as current changes as you move the pointer (you can also see the debug messages on the console like SET 22 - 14 and so on)
So with the Control modifier it works and as Button1 is stated as a valid modifier I expected to work in the same way. Here my working binding and all tries:
The last one is intriguing: it seems to be not a modifier but more a sequence. Anyway I'm happy with <Control-Motion> less carpal tunnel ;)
> To make the sterling and degree work, you must save the script as UTF-8 and add use utf8; towards the top.
Tadąaa! thanks! adding use utf8; on top made sterling and degree to work as expected. My utf8 foo is near to zero.. I did not even suspected the issue.
I've update my code with it ;)
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.