5 // Created by Joseph Spiros on Sat Sep 27 2003.
6 // Copyright (c) 2003 __MyCompanyName__. All rights reserved.
9 #import "ITCategory-NSMenu.h"
11 @interface NSMenu (HACKHACKHACKHACK)
15 extern void _NSGetMenuItemForCommandKeyEvent (NSMenu *menu, void *chicken, void *taco, void *food);
16 extern MenuRef _NSGetCarbonMenu( NSMenu *menu);
18 @implementation NSMenu (ITCategory)
20 - (void)indentItem:(NSMenuItem *)item {
21 [self indentItem:item toLevel:1];
24 - (void)indentItemAtIndex:(int)index {
25 [self indentItemAtIndex:index toLevel:1];
28 - (void)indentItem:(NSMenuItem *)item toLevel:(int)indentLevel {
29 [self indentItemAtIndex:[self indexOfItem:item] toLevel:indentLevel];
32 - (void)indentItemAtIndex:(int)index toLevel:(int)indentLevel {
33 MenuRef carbonMenu = [self menuRef];
35 SetMenuItemIndent(carbonMenu, index + 1, indentLevel);
43 if( [self respondsToSelector:@selector(_menuImpl)] ) {
49 _NSGetMenuItemForCommandKeyEvent(self, NULL, &w00t, &m00f);
50 carbonMenu = _NSGetCarbonMenu(self);