XP is just a number | |
PerlMonks |
Tk::Canvas' response to keystrokesby TomKane (Beadle) |
on Feb 08, 2009 at 12:18 UTC ( [id://742251]=perlquestion: print w/replies, xml ) | Need Help?? |
TomKane has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to create an equation editor. Doing this is something that won't work with a text widget as it requires me to have multiple baselines to accommodate sub- and superscripts, as well as having multiple fonts.
I have a small example just to test how to use canvas directly as a text editor. I can handle taking in keystrokes and adding them to the text on the canvas in a text item. But I'm having a problem handling the keyboard arrow keys. Whenever I press the left arrow, the keystroke binding works correctly, but the entire canvas shifts to the right. I'm hopeful that there will be some way to lock the canvas into place so it doesn't move, and I've looked at a number of ways at doing that, but nothing has worked for me so far. Note that it makes no difference if I bind the left arrow separately, or even if I bind the left arrow to the main window directly. Are there any suggestions?
Back to
Seekers of Perl Wisdom
|
|