TIP #161: Change Default for Menu's -tearoff Option to False

Title:Change Default for Menu's -tearoff Option to False
Version:$Revision: 1.2 $
Author:Mark Roseman <mark at markroseman dot com>
Created:Sunday, 19 October 2003


This TIP proposes changing the default value of the -tearoff option on menu widgets to false, from its current setting of true.


The default presence of tearoffs for Tk's menus originated with the Motif look & feel, which was the platform standard used for earlier Unix-only versions of Tk. In more modern user interface toolkits on Unix, as well as Macintosh and Windows, menus do not normally have tearoffs associated with them. For applications today, menus without tearoffs are the standard, with tearoff menus being the exception.

While turning off the tearoff on menus can be accomplished either with a configuration option on the particular menu, or a global option setting, this can be a source of confusion for the new Tk developer, and too easily forgotten by other developers. Forcing developers to take extra action to achieve "standard" user interface behavior is contrary to Tk's philosophy.

Proposed Change

Implementation of this TIP requires only changing a single default in each of the platform specific tk*Default.h files, and updating the documentation and test cases.


Unfortunately, entries in menus are often accessed by index within scripts, and the presence or absence of tearoff affects this index. Therefore, changing the default setting of this option will affect a large number of scripts. Though fixing these scripts will be straightforward (either through adjusting access to individual menus, or using the option database to turn the tearoff option back on), because of the incompatibility this TIP is proposed for 9.0 rather than 8.x.


This document has been placed in the public domain.

Powered by Tcl[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