Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding an embedded control



On 7/31/05 2:09 PM, Igor Garnov didst favor us with:

> Hello,
> 
> I have installed an event handler for 'kEventMouseDown' event. When I
> receive the event in the handler, I try to get the reference of the
> control, in which the mouse-down event has occurred. But the problem
> is, some of the controls are embedded in a userpane control. And
> 'FindControl' always gives me the reference to this super-control,
> whereas I need the reference to a control, which is embedded in this
> userpane, if there is any at the given coordinates.
> 
> How do I get the reference to this embedded control? I could enumerate
> all of the embedded controls, get their bounding rectangles and call
> 'PtInRect', but isn't there a nicer solution?

You're usually better off listening for higher level events than
kEventMouseDown, such as kEventControlClick. Do you really need work with
the mouse down event? if you used a kEventControlClick, you'd get the
control in the event.

Larry

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Finding an embedded control (From: Igor Garnov <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.