An editable text window
Here is a text area that completelly fills a Tk window.
You can freely edit, cut, copy and paste in the text area.
A non-editable text window
Here is what you get. Try editing the text.
A text window with a vertical scrollbar
Scrolling down reveals the remaining contents of the text widget:
A text window with horizontal and vertical scrollbars (and no word wrap)
Scrolling across reveals the remaining contents of the text widget:
Entering Unicode characters in text windows
You can call a dialog box to enter Unicode characters from within R with the tcltk2 function
You should see the following dialog box:
Naviguate through code pages, then select the character you want by double-click or by hitting
Enter. The character is inserted into the target widget. Now, close the Unicode character selector, but don’t close the text window yet. It is also possible to define a compose key (
Cmp), that is, a key to trigger a sequence of two keys to be combined into a special unicode character. Of course, you can freely choose the compose key and the sequences you want to use. Obvious sequences are:
Cmp + ^ + e → ê,
Cmp + a + e → æ, etc. But you can also define other combinations like
Cmp + O + C → ©, or
Cmp + m + u → µ. for instance. Also, hitting the compose key twice brings back the Unicode selector. Here is how you can configure your
tk2text text widget (or a
tk2entry entry widget) to use the key composer:
Here is the key composer configuration dialog box (as you can see, it is called “Khim”):
You have the opportunity to save your configuration on disk. If you do so, it will persist from session to session.