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

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2017 Conference, Houston/TX, US, Oct 16-20
Send your abstracts to tclconference@googlegroups.com
by Aug 21.
Author:         Mark Roseman <mark@markroseman.com>
State:          Draft
Type:           Project
Vote:           Pending
Created:        19-Oct-2003
Post-History:   
Tcl-Version:    9.0

Abstract

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

Rationale

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.

Compatibility

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.

Copyright

This document has been placed in the public domain.

History