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: Optimizing resize updates in an HIView




On Nov 29, 2007, at 2:41 PM, D. Atkinson wrote:

I have an HIView embedded in a compositing window's content view. My view is also bound to the content view so that it's size expands or contracts along with the window. I only want to draw the portion(s) of my view that are exposed when the window grows. I don't need to re-draw any part of my view if the window contracts. I had hoped that the kEventParamRgnHandle or kEventParamShape provided in the kEventControlDraw event would indicate the exposed (grown) portion of the view, but this does not seem to be the case. Instead, after a resize, it always indicates that the entire view needs to be drawn.

That is correct; the default behavior of the HIView system is to invalidate the entire view when the view resizes.


Before moving to the HIView model, I could determine the exposed portion(s) to draw by examining the window's visible region between calls to BeginUpdate and EndUpdate. How can I accomplish this in a compositing window/HIView?

Install a handler on your HIView for kEventControlInvalidateForSizeChange. In your handler, compare the original and current bounds and use HIViewInvalidateShape (or Region) to invalidate just the newly exposed area rather than the entire area of the view.


-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: 
 >Optimizing resize updates in an HIView (From: "D. Atkinson" <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.