Report-an-Apple-bug Friday! 11
This bug is -[NSMenu menuBarHeight]
always returns 0.0f
. It was filed on 2006-03-17 at 23:55.
UPDATE 2006-03-25: Uploaded test app to GeoCities.
Summary:
NSMenu
's -menuBarHeight
method always returns 0.0f. Even the main menu's.
Steps to Reproduce:
- Call
[[NSApp mainMenu] menuBarHeight]
.
Expected Results:
The method returns 22.0f
.
Actual Results:
The method returns 0.0f
.
Regression:
None known.
Notes:
Appearance Manager (in the form of the GetThemeMenuBarHeight
function) and NSMenuView
(in its +menuBarHeight
method) both return 22.0f, the correct height of the menu bar under Tiger.
The documentation for +[NSMenuView menuBarHeight]
recommends using -[NSMenu menuBarHeight]
instead.
This method is superseded in Mac OS X v10.4 by the NSMenu menuBarHeight instance method.
Following this advice would break one's app on 10.4.3 through 10.4.5 (the bug exists on 10.4.5 as well).
The bug works with any menu — the main menu isn't the only one. It's just the most obvious menu to call that method on.
Workarounds:
Use GetThemeMenuBarHeight
or +[NSMenuView menuBarHeight]
.
0 comments:
Post a Comment
<< Home