\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#360: Modernize X11 Menus}
\date{December 24, 2009}
\author{Pat Thoyts}
\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 \#360}&\textbf{Modernize X11 Menus}\\\hline
Author&

Pat Thoyts \tipmail{patthoyts}{users.sourceforge.net}
\\
Created&Thursday, \(\text{24}^{\text{th}}\) December 2009\\
Type&Project\\
Tcl Version&\(8.6\)\\
State&Final\\
Vote&Done\\
Version&\tipversion$Revision: 1.5 $\\
Keywords&Tk, X11, menu\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

This TIP proposes to modernize the functionality of the Tk menus on X11 to bring Tk up to date with reference to other toolkits on this platform.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{Rationale}

Motif is dead and buried but Tk menus are still aping the Motif feel for \textbf{menu} handling on X11. Specifically all cascade menu items must be actively clicked to open the submenu. Other current toolkits work more like the Windows menus where once one of the menubar items has been clicked to activate its dropdown then subsequent mouse motion is sufficient to open any cascade menu on the menubar or from any of its dropdown menus.

Tk provides magic handling for any menubar item whose name ends in \textbf{.help}. Specifically such a menu gets pinned to the extreme right of the menubar. This is sufficiently unusual that users often miss the help menu completely if they are used to Windows or GNOME applications. This is a hangover from 1990 and needs to go.

\section{Specification}

The menu bindings will be modified to provide a concept of an activated menubar. Once any of the menubar cascade entries has been activated then the current active item will follow the mouse motion and explicit clicks will not be required to activate cascade entries. A small delay will be included when posting a cascade entry except when posting from the menubar. The activation is cancelled on hitting escape, selecting a menu entry or clicking outside the menu.

If the new 'focus-follows-mouse' style behaviour is undesirable it can be disabled using the Tk options database. The Menu option \textbf{clickToFocus} may be set true to restore the original menu behaviour. This can be set using the Tk \textbf{option} command, the X resource database, or by calling \textbf{tk::classic::restore menu}.

The special handling of \textbf{.help} menu entries in the menubar will be removed unless restored using the resource option \textbf{*Menu.useMotifHelp}. This can be set using the Tk \textbf{option} command, the X resource database or by calling the \textbf{tk::classic::restore} command which will set the option along with some others.

\section{Reference Implementation}

Patches posted as Tk patch item \#2920409 [\url{https://sourceforge.net/support/tracker.php?aid=2920409}].

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

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