TIP: | 197 |
Title: | Unfocussed Text Widget Cursor Control |
Version: | $Revision: 1.10 $ |
Authors: |
R. Timothy Edwards <tim at stravinsky dot jhuapl dot edu> Donal K. Fellows <donal dot k dot fellows at manchester dot ac dot uk> |
State: | Final |
Type: | Project |
Tcl-Version: | 8.6 |
Vote: | Done |
Created: | Wednesday, 12 May 2004 |
Keywords: | Tk |
This TIP proposes a simple extension to the Tk text widget to allow the insertion cursor to persist when the window containing the text widget does not have focus.
In some cases it is useful to redirect text from one top-level window into a separate top-level window containing a text widget. In such a case, it is helpful to be able to see the cursor in the text widget. However, as implemented, the Tk text widget always erases the insert cursor when the window loses focus. It is a trivial fix to add an option -insertunfocussed to the text widget that keeps the text cursor in the window.
The extension would provide a global text widget option -insertunfocussed with a ternary value. The current behaviour would be the default.
pathName configure -insertunfocussed value
Supported values will be:
Do not display the insertion cursor when the text widget doesn't have the focus.
Display the border of the insertion cursor when the text widget doesn't have the focus, but do not fill the cursor or make it flash. If the -insertborderwidth option is zero, draw (but do not fill) a rectangle in the -insertbackground color.
Display the insertion cursor unchanged whether or not the text widget has the focus. The insertion cursor will not flash when the widget does not have the focus.
In all cases, the insertion cursor will be displayed as at present when the text widget does have the focus.
This document has been placed in the public domain.
[Index] [History] [HTML Format] [Source Format] [LaTeX Format] [Text Format] [XML Format] [*roff Format (experimental)] [RTF Format (experimental)]
TIP AutoGenerator - written by Donal K. Fellows