TIP #51: Native Menubutton on Macintosh

Title:Native Menubutton on Macintosh
Version:$Revision: 1.4 $
Author:Mats Bengtsson <matben at privat dot utfors dot se>
Created:Saturday, 04 August 2001


This is a replacement for the menubutton on the Macintosh with a native implementation which is compliant with the Appearance Manager in Mac OS 8 and later.


The present (in 8.3.3 and earlier) menubutton on the Macintosh is implemented using Tk drawing to draw something similar to the native menubutton on Mac how it looks on Pre Mac OS 8.0 systems, and therefore fails to give the correct appearance on Mac OS 8.0 systems and later. This TIP presents a step to increase the native appearance on the Macintosh (similar to TIP #25.)

Comparison of Native (to left) and Standard Menu Buttons.

Reference Implementation

The proposed change is now implemented as a loadable extension (in C) on Macintosh, and can be downloaded [1]. This implementation differs from the other buttons in Mac Tk (button, radiobutton, checkbutton), which use a mixture of native Apple drawing code and Tk drawing code, since it uses only native Apple code for drawing. This extension requires Tcl/Tk 8.3.2p1 or later due to the changed stub loading mechanism. The new implementation is not a complete replacement since it lacks the -bitmap and -image options, and a few other things, see below.

The changes necessary are:

All functionality from the documentation that is applicable is implemented in the extension, with some exceptions:

All these deviations are consistent with the look-and-feel of Mac OS 8.0 and on. Existing scripts using menubutton are compatible with the new menubutton.

Open questions:


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