• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSOutlineView Bug (continued)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSOutlineView Bug (continued)


  • Subject: NSOutlineView Bug (continued)
  • From: Steve Gehrman <email@hidden>
  • Date: Thu, 6 Sep 2001 17:01:18 -0700

I'm trying to get around the NSOutlineView bug dealing with option clicking the disclosure triangle. But for some strange reason, my hack has no effect.

I subclassed my outlineView and overrode mousedown to detect when the alternate key is down and if so, create a new event without the option key down and send it along. I also tried posting the event and that didn't work either.

Steve Gehrman


- (void)mouseDown:(NSEvent *)event
{
if ([event modifierFlags] & NSAlternateKeyMask)
[self optionKeyHack:event];
else
{
...
}
}

- (void)optionKeyHack:(NSEvent *)event
{
NSPoint point;
int rowIndex;
id item;

point = [self convertPoint:[event locationInWindow] fromView:nil];
rowIndex = [self rowAtPoint:point];
if (rowIndex != -1)
{
item = [self itemAtRow:rowIndex];

// we don't care about option collapsing
if ([self isItemExpanded:item] || [_dataSource outlineView:self shouldExpandAllForItem:item])
[super mouseDown:event];
else
{
NSEvent *newEvent;
unsigned int newModifiers = [event modifierFlags];

// clear the alternate key
newModifiers = (newModifiers & ~NSAlternateKeyMask);

newEvent = [NSEvent mouseEventWithType:[event type]
location:[event locationInWindow]
modifierFlags:newModifiers
timestamp:[event timestamp]
windowNumber:[event windowNumber]
context:[event context]
eventNumber:[event eventNumber]
clickCount:[event clickCount]
pressure:[event pressure]];

// ** both of these have no effect, the outline view still thinks the option key is down?

[NSApp postEvent:newEvent atStart:YES];
// [super mouseDown:newEvent];
}
}
else
[super mouseDown:event];
}


  • Prev by Date: NSOutlineView Bug
  • Next by Date: [NEWBIE] Right way to make lightweight class/structs?
  • Previous by thread: NSOutlineView Bug
  • Next by thread: [NEWBIE] Right way to make lightweight class/structs?
  • Index(es):
    • Date
    • Thread