Tk Source Code

View Ticket
Login
Ticket UUID: 1881903
Title: tk_messageBox -icon on Mac wrong
Type: Bug Version: obsolete: 8.5.0
Submitter: markroseman Created on: 2008-01-29 16:18:07
Subsystem: 38. [tk_messageBox] Assigned To: das
Priority: 6 Severity:
Status: Open Last Modified: 2008-03-08 07:13:59
Resolution: None Closed By:
    Closed on:
Description:
This was using ActiveTcl anyway.

1. calling tk_messageBox with no icon on Mac OS X results in no icon in the dialog; according to manual pages (and other platforms) it should show the "info" icon

2. "-icon question" shows the "warning" icon

3. "-icon error" shows the application (info) icon
User Comments: nobody added on 2008-03-08 07:13:59:
Logged In: NO 

FYI - Using ActiveTcl 8.5.1 on Mac OSX 10.4.11, only ActiveState icons are displayed:
-icon
  error - ActiveTcl frog
  info - ActiveTcl frog
  question - Yellow exclamation triangle with small ActiveTcl frog
  warning - Yellow exclamation triangle with small ActiveTcl frog

das added on 2008-02-05 21:19:10:
Logged In: YES 
user_id=90580
Originator: NO

Tk_MessageBoxObjCmd() works correctly, no misbehaviour that I can see (ChkErr is a noop in optimized code anyway), but note that the L&F of the standard alert types is OS version dependent, in Leopard, only the caution alert has a badged icon, in older OSX releases (and in OS9) the icons were different, c.f.
    http://lists.apple.com/archives/Carbon-development/2004/May/msg00232.html
    http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGWindows/chapter_18_section_7.html#//apple_ref/doc/uid/20000961-DontLinkElementID_1840

The available alert types are kAlertStopAlert, kAlertNoteAlert, kAlertCautionAlert, kAlertPlainAlert, c.f.
    http://developer.apple.com/documentation/Carbon/Reference/Dialog_Manager/Reference/reference.html#//apple_ref/doc/uid/TP30000200-CH4g-C004670
the current mapping in Tk_MessageBoxObjCmd() is
    -icon error:        kAlertStopAlert         (app icon on Leopard)
    -icon info:         kAlertNoteAlert         (app icon on Leopard)
    -icon question:     kAlertCautionAlert      (badged caution icon on Leopard)
    -icon warning:      kAlertCautionAlert      (badged caution icon on Leopard)
    no -icon:           kAlertPlainAlert        (no icon on Leopard)
as this mapping has been in place for a long time I'm somewhat hesitant to change it for backwards compat reasons, but given the HIG prescription to only use the caution alert rarely, the following might indeed be better:
    -icon error:        kAlertStopAlert         (app icon on Leopard)
    -icon info:         kAlertNoteAlert         (app icon on Leopard)
    -icon question:     kAlertNoteAlert         (app icon on Leopard)
    -icon warning:      kAlertCautionAlert      (badged caution icon on Leopard)
    no -icon:           kAlertNoteAlert         (app icon on Leopard)

hobbs added on 2008-02-05 07:47:11:
Logged In: YES 
user_id=72656
Originator: NO

Confirmed the misbehavior, but the code looks correct.  Possible issue in the ChkErr macro skewing the alertType value?