| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Jan 30, 2007, at 7:57 PM, Bryan Prusha wrote:
On Jan 30, 2007, at 4:48 PM, Rick Mann wrote:
HIViewRef is typedef'd to ControlRef, which is an opaque type. HIObjectRef is its own opaque type.
Internally, are these interchangeable? Can I freely cast from one to the other?
It seems that in the simple example of:
HIObjectRef myView; HIObjectCreate(kMyObjID, null, &myView) HIViewSetFrame(myView, &theFrame);
One runs into problems, requiring a cast.
Are there ever situations where one might have an HIObjectRef that's not an HIViewRef?
Sorry for the pedantic questions; it speaks to programming Carbon from D.
WindowRefs, MenuRefs and HIViewRefs are all HIObjectRefs internally and can be cast appropriately. In the early days of HIObjects each sub type was initially type defined to an HIObjectRef. We noticed there was an issue with C++ routines that differed in signature only by the object type passed in (window, menu, view). In order to preserve this behavior we had to type define them separately but rest assured all windows, menus and views can be used in HIObject APIs.
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
| References: | |
| >ControlRef vs. HIViewRef vs. HIObjectRef (From: Rick Mann <email@hidden>) | |
| >Re: ControlRef vs. HIViewRef vs. HIObjectRef (From: Bryan Prusha <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.