On 25 Oct 2009, at 14:59, simon Scylla wrote:

hello every one

i need to get current system event,waiting until the function get some
event,then remove it from the queue

what should i do?

Usually, *not* that. There are two occasions on which you *might* want to run an event pump yourself:

1. You're implementing mouse tracking. In this case you have two options... either handle mouse events in -mouseDown: in a loop (or in your custom NSCell subclass, again in a loop), or use the three method approach. The three method approach (-mouseDown:/-mouseDragged:/- mouseUp:) is cleaner and easier to subclass, but it's also slightly less responsive.

2. You're writing a computer game. In this case, you're better off asking this question on one of the game developer mailing lists.

Otherwise, you almost certainly don't want to do this. If you're porting code from e.g. Windows that uses its own event pump, there are normally better ways to achieve the same effect on Mac OS X.

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to