//
//  iControllerView.m
//  Hootenanny
//
//  Created by Noah Sorscher on Mon Jan 26 2004.
//  Copyright (c) 2004 __MyCompanyName__. All rights reserved.
//

#import "iControllerView.h"


@implementation iControllerView

- (void)rightMouseDown:(NSEvent *)theEvent
{
    NSMenu *menu = [[NSMenu alloc] init];
    NSArray *chaps = [[[player currentMovie] chapters] chapterNames];
    int i, n = [chaps count];
    for (i=0;i<n;i++) {
        NSMenuItem *item = [[NSMenuItem alloc] init];
        NSString *title = [chaps objectAtIndex:i];
        [item setTitle:title];
        [item setTarget:player];
        [item setAction:@selector(gotoChapter:)];
        [menu addItem:item];
    }
    NSPoint point = [theEvent locationInWindow];
    point = [self convertPoint:point fromView:nil];
    [NSMenu popUpContextMenu:menu withEvent:theEvent forView:self];
}

@end
