• 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
Re: preventWindowOrdering
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: preventWindowOrdering


  • Subject: Re: preventWindowOrdering
  • From: Andreas Schwarz <email@hidden>
  • Date: Tue, 12 Mar 2002 20:54:29 -0800

It sounds like when you call [super mouseDown:], whatever that ends up at decides to run a tracking loop of its own. This is not uncommon. So my guess is that your code is not regaining control until after the mouse-up has occurred. theEvent, however, still contains the mouseDown event (or may contain some other event, as I have heard a rumor that NSEvent objects get reused by the system), so you enter your tracking loop, which proceeds to wait for another mouseUp.

Ah, that explains part of it, thanks. But why does [super mouseDown:] decide to run it's own tracking loops some of the time (only when that particular bit of code is after the [super mouseDown:] call) and not any other time? That doesn't make sense.

BTW, I discovered the culprit to be the "theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask];" line; without that there's no problem, though of course my while loop doesn't function properly. But as I said this line comes AFTER the [super mouseDown:] call and I fail to see why it's existence should affect anything before the program reaches it.


If you're doing your own tracking loop, why are you calling super? Calling super implies that you want super to do its own tracking of the mouseDown, whatever that might be. NSResponder's default implementation passes the call up the responder chain, so any superview that wants to handle the click will take it and do as it pleases. It sounds like that's not what you want...?

I was told to do it after [NSApp preventWindowOrdering]. That doesn't do anything at all unless I call [super mouseDown:] afterwards. Am I doing something wrong?

Andreas
_______________________________________________
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: preventWindowOrdering
      • From: email@hidden
References: 
 >Re: preventWindowOrdering (From: email@hidden)

  • Prev by Date: Re: NSTextField refreshes are wacky.
  • Next by Date: Eliminating NSTableView selection highlighting
  • Previous by thread: Re: preventWindowOrdering
  • Next by thread: Re: preventWindowOrdering
  • Index(es):
    • Date
    • Thread