Subclassing NSTabView & handling mouseDragged messages
Subclassing NSTabView & handling mouseDragged messages
- Subject: Subclassing NSTabView & handling mouseDragged messages
- From: Kay Roepke <email@hidden>
- Date: Mon, 29 Mar 2004 15:56:24 +0200
Hi!
Suppose I have a subclass of NSTabView and I want to implement
'tear-off' tabs, via drag and drop. I'd like to be able
to drag a NSTabView out of the TabView, so the tab's contentview
becomes a separate window. (Reverse way should be possible to do, too).
Doesn't seem to be a great problem, but:
When subclassing NSTabView and overriding mouseDragged:, it never gets
called. This is because mouseDown: is sent before
mouseDragged: (obviously) and mouseDown: of NSTabView uses NSApps
nextEventMatchingMask:untilDate:inMode:dequeue: (or rather
NSMouseTracker, not sure) to short-circuit the event handling.
mouseDown: never returns until the mouse button is released.
Now I'm not sure how to intercept the mouseDragged: message without
breaking everything in mouseDown:.
Of course I could mimick the mouseDown: behavior myself, but since I
don't know the implementation of NSTabView's mouseDown:
I'd rather not mess with that.
Any ideas or pointers?
And no, I don't particularly want to rewrite NSTabView (since I'm
planning to do this kind of stuff with other UI elements, too).
BTW Apple: Why is NSMouseTracker not public? It certainly seems like a
useful tool to me, and since it's in the AppKit...well?
Regards,
Kay
_______________________________________________
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.