NSBrowser Drag Source
NSBrowser Drag Source
- Subject: NSBrowser Drag Source
- From: Timothy Ritchey <email@hidden>
- Date: Sat, 13 Dec 2003 19:00:53 -0500
After searching through the archives, I found out how to get the
NSBrowser to act as a drag source by subclassing NSMatrix. I seem to be
having problems with the selection however. I only ever get the first
browser column to highlight in blue. I can select entries in other
columns, but they never seem to get the focus. The selection are always
grey. I got the following code from the archives, but there seems to be
something missing to get the focus right:
- (void)mouseDown:(NSEvent *)event
{
// need to override this because NSMatrix eats drag events
int row, col;
if ([self getRow: &row column: &col
forPoint:[self convertPoint:[event locationInWindow]
fromView: nil]]) {
[self selectCellAtRow: row column: col];
[self sendAction];
} else {
[super mouseDown: event];
}
}
Does anyone have a more sure-fire way of getting a browser to act as a
dragging source? Thanks for any advice.
Cheers,
tim
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.