in reply to Re^2: Tags in TK Text widgets
in thread Tags in TK Text widgets
The obvious thing to do would be to show what the Morse code guy would send in place of "\n", which would be the prosign {BT}. I used enclosing curly brackets to designate a prosign. When writing a prosign by hand, there would be a line atop the characters "BT". Instead of BT, move the underline to on top of the characters. If you send the characters: "BT", there will be 3 dots worth of time spacing between the B and the T. When sent as a prosign, there is no spacing and the two characters are run together. When someone runs characters together unintentionally, they are known as a "swing fist" and it is very hard to understand them!
Samuel Morse's historic message would have been sent: "WHAT HATH GOD WROUGHT {SK}", the prosign SK means the end of the message. There are a bunch of common prosigns: {BT} (change of thought/paragraph), {AS} (standby). {AA} (All After). {BK} ("over to you") among them.
You say you are teaching beginners. I would not teach the weirdo math characters +-*= as a first pass. I suggest you come up with a list of prosigns to teach - these will be heard far more often than these "math" characters. Another issue is how to represent the Error symbol. That is 8 dits in a row. I've never written a character for that because this is the "oops" character when you have botched the spelling of a word or other error. But I suppose if this is some test lesson script, you would want to include that so the students will know how to deal with it when they hear it.
For other UI possibilities, I think it would be possible to have the input refuse to enter any illegal character. Perhaps it looks to the user like nothing happens when he types "&". Some prototyping and extra thought are required to see if that idea pans out.
I did run your code. I had to install the TFrame module. For this demo, Frame would have sufficed. I see weird spaces in a number of places on my display. Like extra space before the highlighted "&" or when a space character precedes a "bad" character. This extra space is not composed of space characters since a "copy-n-paste" does not copy any extra spaces. I am puzzled by this behavior and I don't know if it is because of the ancient version of Perl that I run (5.24). I am still fiddling with a few ideas.
I suppose you could be teaching Morse as part of an HST (High Speed Telegraphy) competition? If so, I would read the rules on the universe of symbols that could be sent.
Update: Oh not all prosigns are 2 letters, {AAA} is a "full stop". Some old guy on the Titanic would have been familiar with that, but I don't hear that. Update- that's not right - just forget it.
|
|---|