/* NSMenuAdditions.m created by ovidiu on Sat 29-Mar-1997 */

#import "NSMenuAdditions.h"

@implementation NSMenu (NSMenuAdditions)

- (NSMenuItem*)itemWithSlashedTitle:(NSString*)title
{
    NSArray* path = [title componentsSeparatedByString:@"/"];
    int i, count = [path count];
    NSMenuItem* cell = nil;
    NSMenu* menu = self;

    for (i = 0; i < count; i++) {
        cell = [menu itemWithTitle:[path objectAtIndex:i]];
        if ([cell hasSubmenu])
            menu = [cell target];
        else
            menu = nil;
    }

    return cell;
}

@end
