\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#197: Unfocussed Text Widget Cursor Control}
\date{May 12, 2004}
\author{R. Timothy Edwards, Donal K. Fellows}
\urlstyle{sf}
\setlength{\parskip}{1ex}
\setlength{\parindent}{0pt}
\def\tipversion$#1${\texttt{\$#1\$}}
\def\tiplangle#1{\ensuremath{<}}
\def\tiprangle#1{\ensuremath{>}}
\def\tipbar#1{\ensuremath{|}}
\def\tipmail#1#2{\(\langle\){\small\expandafter\url{#1@#2}}\(\rangle\)}
\ifx\pdfoutput\undefined
\newcommand{\tipimage}[2]{\typeout{Make sure you download #1.eps}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.eps}}{\includegraphics[width=0.8\textwidth]{#1.eps}}}
\newcommand{\tipxref}[1]{}
\newcommand{\tipxrefend}{}
\else
\newcommand{\tipimage}[2]{\typeout{Make sure you create #1.pdf}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.pdf}}{\includegraphics[width=0.8\textwidth]{#1.pdf}}}
\pdfcatalog{/PageMode /UseOutlines}
\newcommand{\tipxref}[1]{\pdfannotlink attr {/C [0.5 0.5 1.0] /Border [0 0 1]} goto name {#1}}
\newcommand{\tipxrefend}{\pdfendlink}
\fi
\newenvironment{tipabstract}{\begin{abstract}}{\end{abstract}}
\begin{document}\maketitle
\begin{center}\begin{tabularx}{\linewidth}{|r@{: }X|}\hline
\textbf{TIP \#197}&\textbf{Unfocussed Text Widget Cursor Control}\\\hline
Author&

R. Timothy Edwards \tipmail{tim}{stravinsky.jhuapl.edu}
\par
Donal K. Fellows \tipmail{donal.k.fellows}{manchester.ac.uk}
\\
Created&Wednesday, \(\text{12}^{\text{th}}\) May 2004\\
Type&Project\\
Tcl Version&\(8.6\)\\
State&Final\\
Vote&Done\\
Version&\tipversion$Revision: 1.10 $\\
Keywords&Tk\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

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.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{Rationale}

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 \textbf{-insertunfocussed} to the text widget that keeps the text cursor in the window.

\section{Specification}

The extension would provide a global \textbf{text} widget option \textbf{-insertunfocussed} with a ternary value. The current behaviour would be the default.

\begin{quote}
\textit{pathName} \textbf{configure -insertunfocussed} \textit{value}
\end{quote}

Supported values will be:
\begin{description}
\item[none]
Do not display the insertion cursor when the text widget doesn't have the focus.
\item[hollow]
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 \textbf{-insertborderwidth} option is zero, draw (but do not fill) a rectangle in the \textbf{-insertbackground} color.
\item[solid]
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.
\end{description}

In all cases, the insertion cursor will be displayed as at present when the text widget does have the focus.

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

\textit{TIP AutoGenerator --- written by Donal K. Fellows}
\end{document}
