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: ControlRef vs. HIViewRef vs. HIObjectRef




On Jan 31, 2007, at 5:00 AM, David A. Lyons wrote:

On Jan 30, 2007, at 7:19 PM, Laurence Harris wrote:

"WindowRefs, MenuRefs and HIViewRefs are all HIObjectRefs internally and can be cast appropriately." Don't forget to read those headers.. er.. first sentences. ; )

Yes, I read this, but as I read it I don't see it addressing the original question. I understand that an HIViewRef is an HIObjectRef, a WindowRef is an HIObjectRef, and a MenuRef is an HIObjectRef. "Can be cast appropriately" is kind of vague, but it says to me you can cast WindowRefs, MenuRefs and HIViewRefs to HIObjectRefs. But nothing in that says a WindowRef is an HIViewRef or that you can casts WindowRefs to HIViewRefs. That may be the case, but it doesn't follow from the statement above.

They aren't, and you can't. -- "Appropriately" means that you can cast any of them to an HIObjectRef, and if you have an HIObjectRef you can cast it to whatever more specific type you know it actually is.

That's what I figured. However, the OP had asked "Are there ever situations where one might have an HIObjectRef that's not an HIViewRef?" The answer is yes, but that wasn't stated previously, and it cannot be logically deduced from the statement quoted above.


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: 
 >ControlRef vs. HIViewRef vs. HIObjectRef (From: Rick Mann <email@hidden>)
 >Re: ControlRef vs. HIViewRef vs. HIObjectRef (From: Bryan Prusha <email@hidden>)
 >Re: ControlRef vs. HIViewRef vs. HIObjectRef (From: Laurence Harris <email@hidden>)
 >Re: ControlRef vs. HIViewRef vs. HIObjectRef (From: Bryan Prusha <email@hidden>)
 >Re: ControlRef vs. HIViewRef vs. HIObjectRef (From: Laurence Harris <email@hidden>)
 >Re: ControlRef vs. HIViewRef vs. HIObjectRef (From: "David A. Lyons" <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.