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

Re: pump event


  • Subject: Re: pump event
  • From: Alastair Houghton <email@hidden>
  • Date: Mon, 26 Oct 2009 10:46:32 +0000

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 (email@hidden)

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:
This email sent to email@hidden


References: 
 >pump event (From: simon Scylla <email@hidden>)

  • Prev by Date: Re: kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid region
  • Next by Date: Re: Professional Error Handling
  • Previous by thread: Re: pump event
  • Next by thread: PackageMaker installer not always installing into /Applications
  • Index(es):
    • Date
    • Thread