dogrunjp
8/22/2011 - 11:10 PM

Cocoa Menu Item Title Toggle

Cocoa Menu Item Title Toggle

# pragma mark menu

- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
    if ([menuItem action] == @selector(toggleRuler:)) {
        if ([canvasView rulersVisible]) {
            [menuItem setTitle:@"Hide Ruler"];
        } else {
            [menuItem setTitle:@"Show Ruler"];
        }
    }
    
    return YES;
}

# pragma mark ruler

- (void)toggleRuler:(id)sender {
    [canvasView toggleRuler:sender];
}