anonuser
2004.09.05, 03:12 PM
I created several controls, all have the same signature just as they should and differ by ID.
Here's what my event type spec looks like.
EventTypeSpec mainSpec[] = {
{ kEventClassCommand, kEventCommandProcess },
{ kEventClassMouse, kEventMouseDown },
{ kEventClassControl, kEventControlActivate }
};
I install the window handler, as a general purpose handler.
I get my command from my event, just as you would normally.
But I need to know which control sent the event.
I figured this would work.
GetEventParameter(event,kEventParamControlRef,
typeControlRef,NULL,sizeof(test),
NULL,&test)
but that doesn't work.
I get -1700 for a result code, unkown control.
I've tried several different Params.
none work.
I never get a control ref.
which i really really need.
Let me know if you want me to post the entire application. I'ts rather messy because of debug code, but i'll clean it up if you want it posted.
Here's what my event type spec looks like.
EventTypeSpec mainSpec[] = {
{ kEventClassCommand, kEventCommandProcess },
{ kEventClassMouse, kEventMouseDown },
{ kEventClassControl, kEventControlActivate }
};
I install the window handler, as a general purpose handler.
I get my command from my event, just as you would normally.
But I need to know which control sent the event.
I figured this would work.
GetEventParameter(event,kEventParamControlRef,
typeControlRef,NULL,sizeof(test),
NULL,&test)
but that doesn't work.
I get -1700 for a result code, unkown control.
I've tried several different Params.
none work.
I never get a control ref.
which i really really need.
Let me know if you want me to post the entire application. I'ts rather messy because of debug code, but i'll clean it up if you want it posted.