<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE TIP SYSTEM "http://tcl.activestate.com/cgi-bin/tct/tip/tipxml.dtd">
<!-- Converted at Thu Feb 09 07:44:04 GMT 2012 -->
<!-- TIP AutoGenerator - written by Donal K. Fellows -->

<TIP number='25'>
<header><title>Native tk_messageBox  on Macintosh</title><author address="mailto:matben@privat.utfors.se">Mats Bengtsson</author><status type='project' state='withdrawn' tclversion="8.5" vote='prior'>$Revision: 1.3 $</status><history></history><created day='7' month='feb' year='2001' /><obsoleted tip='152'/></header>
<abstract>This is a replacement for the <emph style="italic">tk_messageBox</emph> on the Macintosh with a native implementation which is compliant with the Appearance Manager in Mac OS 8 and later.</abstract>
<body><section title="Rationale">
<para>The present (in 8.3.2p1 and earlier) <emph style="italic">tk_messageBox</emph> 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.</para>
<image src="25original" caption="This is the present tk_messageBox." />
<image src="25native" caption="This is the native tk_messageBox." />
</section>
<section title="Reference Implementation">
<para>The proposed change is now implemented as a loadable extension (in C) on Macintosh, and can be downloaded at <url ref="http://hem.fyristorg.com/matben/download/MovableAlerts.sit"/> . 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 <emph style="italic">tkMacDialog.c</emph> file. Some additional changes are necessary in order to load the new <emph style="italic">tk_messageBox</emph> and not the old, script based <emph style="italic">tk_messageBox</emph>. Also, need to check for the presence of the Appearance manager:</para>
<verbatim><vline encoding='base64'>aWYgKEFwcGVhcmFuY2UgTWFuYWdlcik=</vline><vline encoding='base64'>ICAgIHVzZSBuYXRpdmUgKG5ldykgbWVzc2FnZUJveA==</vline><vline encoding='base64'>ZWxzZQ==</vline><vline encoding='base64'>ICAgIHVzZSBwcmVzZW50IHNjcmlwdCBiYXNlZCBtZXNzYWdlQm94</vline></verbatim>
<para>All functionality from the documentation that are applicable are implemented, with some exceptions:</para>
<itemize><item.i><para> There is a <emph style="italic">-finemessage</emph> option to support the native text message set in a smaller font below the main message.</para></item.i><item.i><para> Both <emph style="italic">-message</emph> and <emph style="italic">-finemessage</emph> option are truncated at 255 characters.</para></item.i><item.i><para> Buttons appear from right to left instead of vice versa.</para></item.i><item.i><para> There is always a default button. </para></item.i></itemize>
<para>All these deviations are consistent with the look-and-feel of Mac OS 8.0 and on. Existing scripts using <emph style="italic">tk_messageBox</emph> are compatible with the new <emph style="italic">tk_messageBox</emph>.</para>
<para>Open questions: </para>
<itemize><item.i><para> Name of extra option <emph style="italic">-finemessage</emph></para></item.i><item.i><para>Name of the two C functions in the implementation</para></item.i><item.i><para>How to make the core code call the new code instead of the original, script implemented</para></item.i></itemize>
</section>
<section title="Copyright">
<para>This document has been placed in the public domain</para>
</section>
</body></TIP>

