Eventhandling

Hi guys,

what is the best way to implement a Multitouch Eventhandler for a specific object
on iphone or iPad?

I read a lot, but I didnt know how to do it. I took a look at MSAInteractiveObject but it doesnt support touch handling.

I also try that for a Button class

  
  
class Button{  
public:  
	Button(float _x, float _y, float _w, float _h);  
	~Button();  
	  
	void update(); // update method, used to refresh your objects properties  
	void draw(); // draw method, this where you'll do the object's drawing   
  
	  
	void touchDown(ofTouchEventArgs &touch);  
	void touchMoved(ofTouchEventArgs &touch);  
	void touchUp(ofTouchEventArgs &touch);  
	void touchDoubleTap(ofTouchEventArgs &touch);  
	  
	float x,y,w,h;  
  
};  
  

I create the Button in TestApp which is inherit by ofxiPhoneApp.
In testApp::setup i Register the Tocuhes for the Button.

  
  
void testApp::setup(){	  
	button = new Button(10,10,100,100);  
	ofRegisterTouchEvents(button);  
}  
  

When i touch the iphone Simulator the Button::touchDown() receive the Touchevent of the hole App.
But i like to receive only the touches of the Button Area.

How can i do this?

Cheers
Marco