Re: preventWindowOrdering
Re: preventWindowOrdering
- Subject: Re: preventWindowOrdering
- From: Andreas Schwarz <email@hidden>
- Date: Tue, 12 Mar 2002 21:37:26 -0800
I guess I'm not clear on why you're so sure you're affecting the
behaviour of super's tracking loop. It sounds to me like super is
running its tracking loop regardless of whether your code is there or
not. It is your code, after the call to super, that is making things
behave wonkily.
The reason is that when that line is there after the call to super, the
app doesn't leave the call to super until the user makes another click.
This doesn't make any sense to me, of course, because since the app is
staying in the [super mouseDown:] method it never even reaches that
line! But when that line isn't there, [super mouseDown:] behaves as it
should (I assume) and control returns to my mouseDown: method. How come
in one instance [super mouseDown:] waits for another mouse click and in
the other it doesn't?
Calling super is not requisite. I think the other poster was
assuming that you wanted to get your standard, inherited click
behavior, but simply wanted the click not to bring your window
forward. This was why they suggested calling super. But if you want
to be doing your own tracking loop (and it sounds like you do), then
there's no reason to call super. Make your call to [NSApp
preventWindowOrdering], do your tracking loop, and return.
This makes sense, but it didn't seem to work without the call to super.
I think perhaps that was just because the call to super was messing up
the event loop and my app was no long responding to clicks properly and
the window didn't come forward. I just tested it again and now that
I've commented out the code that was causing trouble, calling
preventWindowOrdering either with or without [super mouseDown:] has no
effect at all (the window still comes to the front no matter what).
In other words, to get [NSApp preventWindowOrdering] to do what you
want, simply insert it into whatever mouseDown processing would
otherwise be going on.
Well, I did and nothing changes :-\.
It sounds like you might want to read up on NSResponder, the first
responder chain, and tracking loops in the doc. You seem to be a
little unclear as to what exactly your call to super is doing, here.
I'm new to Cocoa, so I certainly don't know plenty of stuff ;-). I'll
give it another look.
Thanks,
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.