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