TIP #25: NATIVE TK_MESSAGEBOX ON MACINTOSH ============================================= Version: $Revision: 1.3 $ Author: Mats Bengtsson State: Withdrawn Type: Project Tcl-Version: 8.5 Vote: Pending Created: Wednesday, 07 February 2001 URL: https://tip.tcl-lang.org25.html Post-History: Obsoleted-By: TIP #152 ------------------------------------------------------------------------- ABSTRACT ========== This is a replacement for the /tk_messageBox/ on the Macintosh with a native implementation which is compliant with the Appearance Manager in Mac OS 8 and later. RATIONALE =========== The present (in 8.3.2p1 and earlier) /tk_messageBox/ on the Macintosh is non-movable, and lacks many features that are required to be compliant with Mac OS 8 and later. Non-movable dialogs should be abandoned in a multitasking environment. This TIP presents a step to extend the native appearance on the Macintosh. +-----------------------------+ |+-+ Map 'itemHit' (1,2,3) to | ||?| descriptive text string. | |+-+ | | ,-----. ,----. ,--------. | | | Yes | | No | | Cancel | | | `-----' `----' `--------' | +-----------------------------+ (This text representation does not do justice to the original) This is the present tk_messageBox. +-------------------------------------------+ +-------------------------------------------+ | +-+ Map 'itemHit' (1,2,3) to descriptive | | |?| text string. | | +-+ | | ,--------. ,----. ,=====. | | | Cancel | | No | | Yes | | | `--------' `----' `=====' | +-------------------------------------------+ (This text representation does not do justice to the original) This is the native tk_messageBox. REFERENCE IMPLEMENTATION ========================== The proposed change is now implemented as a loadable extension (in C) on Macintosh, and can be downloaded at . This extension requires Tk 8.3.2p1 or later due to the changed stub loading mechanism. The core of the code should go in the /tkMacDialog.c/ file. Some additional changes are necessary in order to load the new /tk_messageBox/ and not the old, script based /tk_messageBox/. Also, need to check for the presence of the Appearance manager: if (Appearance Manager) use native (new) messageBox else use present script based messageBox All functionality from the documentation that are applicable are implemented, with some exceptions: * There is a /-finemessage/ option to support the native text message set in a smaller font below the main message. * Both /-message/ and /-finemessage/ option are truncated at 255 characters. * Buttons appear from right to left instead of vice versa. * There is always a default button. All these deviations are consistent with the look-and-feel of Mac OS 8.0 and on. Existing scripts using /tk_messageBox/ are compatible with the new /tk_messageBox/. Open questions: * Name of extra option /-finemessage/ * Name of the two C functions in the implementation * How to make the core code call the new code instead of the original, script implemented COPYRIGHT =========== This document has been placed in the public domain ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows