MouseDown of superclass
MouseDown of superclass
- Subject: MouseDown of superclass
- From: Tobias Hermann <email@hidden>
- Date: Thu, 20 Mar 2003 12:23:46 +0100
hi!
I have a subclass of NSBrowser. In that subclass, I override the
mouseDown, mouseUp and mouseDragged method, in order to alter it's
behaviour for some situations (not for all!). For the things I want to
let handle the original NSBrowser, I call [super mouseXXXX: event];
(down, dragged or up).
Now something strange happens:
When I call [super mouseDown: event]; within my own mouseDown method, i
get no mouseDragged or mouseUp events anymore... It seems that the
super class NSBrowser grabs the control of the program within its
mouseDown method UNTIL THE MOUSE BUTTON IS RELEASED!
Proof: my mouseDown method:
- (void) mouseDown: (NSEvent *) event
{
NSLog(@"mouse down IN");
[super mouseDown: event];
NSLog(@"mouse down OUT");
}
When pressing the left mouseButton, I get an "mouse down IN" only. The
correct behavior in MY opinion would be that I also should get a "mouse
down OUT" immediately. But i get it AFTER i released the mouse button.
And i don't get any mouseDragged and mouseUp events at all!
Why is that? I tested this with a subclass of NSOutlineView as well and
it was the same thing there...
Why does the mouseDown method of these classes grab the control of the
program and makes his own event loop handling during its runtime?
That seems really odd. For example if you just want to do some stuff in
mouseDragged or mouseUp, you have to override mouseDown (and do NOT
call super mousedown!!) and implement all what the original mouseDown,
mouseDragged and mouseUp routines would have done!
Any ideas?
Thanx for any help!
Tobi
_______________________________________________
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.