void mouseDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { // If this is a combo box with an editor field and the control is disposed // while the view's cell editor is open we crash while tearing down the // popup window. Fix is to retain the view before letting Cocoa track // the mouse events. // 'view' will be cleared if disposed during the mouseDown so cache it. NSView viewCopy = view; viewCopy.retain(); super.mouseDown(id, sel, theEvent); viewCopy.release(); }
void mouseDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { if (id == view.id) { // Bug/feature in Cocoa: If the tree has a context menu we just set it visible instead of returning // it from menuForEvent:. This has the side effect, however, of sending control-click to the NSTableView, // which is interpreted as a single click that clears the selection. Fix is to ignore control-click, NSEvent event = new NSEvent(theEvent); if ((event.modifierFlags() & OS.NSControlKeyMask) != 0) return; } super.mouseDown(id, sel, theEvent); }
void mouseDown (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) { if (id == view.id) { // Bug/feature in Cocoa: If the table has a context menu we just set it visible instead of returning // it from menuForEvent:. This has the side effect, however, of sending control-click to the NSTableView, // which is interpreted as a single click that clears the selection. Fix is to ignore control-click if the // view has a context menu. NSEvent event = new NSEvent(theEvent); if ((event.modifierFlags() & OS.NSControlKeyMask) != 0) return; } super.mouseDown(id, sel, theEvent); }