One Quickie


Forwarding key events to another window (NSWindow->Random)
To forward key events to another window, make subclass of NSWindow and override sendEvent:
- (void) sendEvent: (NSEvent *) anEvent
{
    if ([anEvent type] == NSKeyDown) {
        [someOtherWindow sendEvent: anEvent];

    } else {
        [super sendEvent: anEvent];
    }

} // sendEvent
It's up to you to figure out what "someOtherWindow" is, whether it's a delegate or an instance variable that holds the other window.



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com