• 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
MouseDown of superclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: MouseDown of superclass
      • From: "John C. Randolph" <email@hidden>
    • Re: MouseDown of superclass
      • From: j o a r <email@hidden>
  • Prev by Date: DocumentController and Folders
  • Next by Date: Re: Mouse and buttons
  • Previous by thread: DocumentController and Folders
  • Next by thread: Re: MouseDown of superclass
  • Index(es):
    • Date
    • Thread