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: kHIViewWindowContentID kind not in headers?




On Jan 18, 2006, at 4:03 PM, Tomas Zahradnicky wrote:

Hi Eric,

I'm using HIViewGetKind function to find out the kind of various HIViews and noticed that kHIViewWindowContentID's kind 'cnvw' is not in the headers.

The intention is that you just use the constant "kHIViewWindowContentID", and don't use the actual four-char code. In theory, that would let us change the four-char code if necessary. In practice, that's virtually impossible, because apps probably hardcode the four-char code at times. We'd still discourage doing that, though.

If I understand it properly, I'm supposed to use kHIViewWindowContentID and find 'cnvw' from it dynamically.

I guess the question is, why do you need to know exactly what four- character constant is contained in kHIViewWindowContentID?


If I use the following method I get appl/upan:

    GetRootControl( GetControlOwner( hiView ), &rootControl );
    err = GetControlData( rootControl,
                          kControlEntireControl,
                          kControlKindTag,
                          sizeof(ControlKind),
                          &ck,
                          &size);

SIZE IS SET TO NONSENSE. BUG!

Hmm, yes, the user pane control fails to set the output size when it handles kControlSizeTag. I'll fix that.


---------------------------------------
This method gives appl/cnvw:

        HIViewFindByID( HIViewGetRoot(HIViewGetWindow(hiView)),
                        kHIViewWindowContentID,
                        &contentViewRef );

    err = GetControlData( contentViewRef,
                          kControlEntireControl,
                          kControlKindTag,
                          sizeof(ControlKind),
                          &ck,
                          &size);

SIZE IS SET TO 8. OK!
----------------------------------------
This method gives appl/cnvw as well:

        HIViewFindByID( HIViewGetRoot(HIViewGetWindow(hiView)),
                        kHIViewWindowContentID,
                        &contentViewRef );

err = HIViewGetKind( contentViewRef, &contentViewKind );

How about this method?

ControlKind contentViewKind = kHIViewWindowContentID;
// contentViewKind is set to appl/cnvw

-eric

_______________________________________________
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: 
 >kHIViewWindowContentID kind not in headers? (From: Tomas Zahradnicky <email@hidden>)
 >Re: kHIViewWindowContentID kind not in headers? (From: Eric Schlegel <email@hidden>)
 >Re: kHIViewWindowContentID kind not in headers? (From: Tomas Zahradnicky <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.