Re: best way to refuse events?
Re: best way to refuse events?
- Subject: Re: best way to refuse events?
- From: "Timothy J. Wood" <email@hidden>
- Date: Fri, 16 Aug 2002 23:22:04 -0700
On Friday, August 16, 2002, at 09:58 PM, Matt Neuburg wrote:
At 9:43 PM -0700 8/16/02, thus spake Timothy J. Wood:
NSDate *distantPast = [NSDate distantPast];
NSEvent *event;
while ((event = [NSSApp nextEventMatchingMask:NSAnyEventMask
untilDate:distantPast
inMode:NSDefaultRunLoopMode
dequeue:YES])) {
// do nothing with the event
}
Whoa. So, even though the docs say that this "returns the *next* event
matching mask, or nil if no such event is found *before* the expiration
date", you can provide an untilDate in the past, and suddenly "until"
means
"after", "next" means "previous", and "before" means "after"? Is this
universal throughout Cocoa - I can make time run backwards this way?
Thx -
m.
Heh... :)
This means that if no event is pending, the method should return
immediately (since the date given is in the past). Thus, this will
loop discarding events until there are no more events to process.
-tim
_______________________________________________
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.