The Tk Text Widget
A few problems can be found in using the Tk text widget. When a tool has been around for as long as this one, the number of problems become fairly small. There is one significant problem with the widget as it stands, however. In order to get the full benefits of margin handling and the like, text needs to be inserted without newline characters. That is, each paragraph needs to be one long string with a newline at the end. This allows the word wrapping to work properly. However, the widget's default keyboard navigation behaviour is that pressing the up or down arrow key moves up or down a real line, rather than a displayed line. The effect is to skip up or down a paragraph at a time instead of a line, and so the only way to move to the middle of a paragraph is to hold the right arrow key and allow the cursor to work its way across and downwards.
Given the quality of thought and implementation that clearly has gone into the rest of the widget, it's hard to see how this behaviour has been tolerated for so long. The problem finally was addressed for Tk 8.5, which, as of this writing, is in alpha release. In the meantime, the Tcler's Wiki has a workaround that installs more sensible behaviour, see Resources.
The Tk text widget is a remarkably powerful tool available to script writers who work with Tcl, Python and Perl. In its basic form it allows multi-line text entry, with rich text formatting and undo facilities where appropriate. Its more powerful features provide a framework for implementing all sorts of interesting facilities, including image handling, embedded GUI controls, mouse overs and hyperlinks. If your application involves the manipulation or presentation of textual information, the abilities of Tk's text widget should not be overlooked.
|NTPsec: a Secure, Hardened NTP Implementation||Mar 30, 2017|
|SUSE Linux Enterprise High Availability Extension||Mar 29, 2017|
|Hybrid Cloud Storage Delivers Performance and Value||Mar 29, 2017|
|smbclient Security for Windows Printing and File Transfer||Mar 28, 2017|
|How to Calculate Flash Storage TCO||Mar 27, 2017|
|Non-Linux FOSS: Don't Drink the Apple Kool-Aid; Brew Your Own!||Mar 27, 2017|
- NTPsec: a Secure, Hardened NTP Implementation
- smbclient Security for Windows Printing and File Transfer
- Hybrid Cloud Storage Delivers Performance and Value
- SUSE Linux Enterprise High Availability Extension
- Returning Values from Bash Functions
- Non-Linux FOSS: Don't Drink the Apple Kool-Aid; Brew Your Own!
- William Rothwell and Nick Garner's Certified Ethical Hacker Complete Video Course (Pearson IT Certification)
- Hodge Podge
- HOSTING Monitoring Insights
- Three EU Industries That Need HPC Now