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




On Nov 30, 2004, at 4:32 PM, Jan E. Schotsman wrote:


On 30-nov-04, at 23:23, R. Scott Thompson wrote:

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))


So these (the window root and the content view) can be different?

When you are looking at things from the point of view of HIView, they are different. That flexibility thing I was talking about earlier comes into play.


The root of the HIView system is a view that is often called the "structure view" of the window. The direct children of the structure view includes things like the views that put the little colored dots in the upper left hand corner (the close, collapse, and zoom boxes), a view for the title bar, and the content view. The root view is also the one that (presumably) draws the rounded corners of the window. When you call HIViewGetRoot... you really get the ROOT of the window.

Contrast this with the classic control manager call GetRootControl. This routine actually returns the same control as the content view in the HIView hierarchy.

If you want to have some fun, set up some code that crawls the HIView hierarchy staring at the root and prints out the class IDs of all the controls it finds... that can be fun. Also, try installing a kEventControlDraw event on the root view of a window and draw something wacky into it. Geek Toys!

If you want to create a completely custom window, you can do so by creating a custom subclass of HIView that implements all the drawing for the root of your window. Your root view will also have to manage things like creating and positioning the content view. Keeping the origin for the port of the content view set up properly (if you are using QuickDraw in that window) etc...

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>)
 >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.