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: HIView embedder



Thanks Scott. So my replacement looks like this (error checking omitted):

void MyHICreateEmbedderPane( WindowRef window, HIRect hiBounds, HIViewRef *userPane )
{
HIViewRef root = HIViewGetRoot( window );


HIObjectCreate( kHIViewClassID, nil, (HIObjectRef *)userPane );


HIViewChangeAttributes( *userPane, kHIViewAllowsSubviews, 0 );

HIViewAddSubview( root, *userPane );

HIViewSetFrame( *userPane, &hiBounds );
}

That's still 5 lines of code to get rid of the Control Manager function.

It will get worse before it gets better :-)

You probably don't want to embed your user pane in the root control returned by HIViewGetRoot. What you probably want to do is:

HIViewRef root = NULL;

verify_noerr(HIViewFindByID(HIVIewGetRoot(window), kHIViewWindowContentID, &root))

...

The flexibility of HIViews being able to exist outside of windows and such does add a certain amount of code overhead since you have to tell the system where you want the view to go by default, but on the whole I find the greater flexibility to be worth the minor effort. YMMV.

Scott
 _______________________________________________
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: 
 >HIView embedder (From: "Jan E. Schotsman" <email@hidden>)
 >Re: HIView embedder (From: "R. Scott Thompson" <email@hidden>)
 >Re: HIView embedder (From: "Jan E. Schotsman" <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.