Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Informing HIToolbar of a size constraints change
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Informing HIToolbar of a size constraints change




On Jun 26, 2007, at 5:37 PM, Eric Schlegel wrote:


On Jun 26, 2007, at 8:20 AM, Trenton Schulz wrote:

Hi everyone,

If I add an HIView that is hidden and it is not conveinent to calculate its size constraints at that point (so its minimum and maximum is then (0, 0)). However, at some point later on, I show the HIView and it doesn't get any space on the HIToolbar. If I resize the window, HIToolbar will ask for the size constraints again and then it will get the space needs.

I guess this is OK in the sense that originally the view did say that it didn't need any space. Aside from resizing the window, is there a way to invalidate your size constraint(s) so that HIToolbar will ask again or at least let it know it has changed? I've hunted through the headers, but nothing is jumping out at me?

I don't think there's any way to let the HIToolbox know that your size constraints have changed, but one trick you could use would be to hide the toolbar and show it again, and wrap both operations in DisableScreenUpdates/EnableScreenUpdates so that toolbar appears to atomically resize.

Yes, that did the trick nicely. Thanks! :)


You could also file a bug requesting a better way to do this. In Leopard, we have added a kEventControlOptimalBoundsChanged event which the toolbar could handle (but doesn't currently) and if we implemented that, then you could send the event from your view.

Hmm... yes, that was indeed what I was looking for. I've filed the report here:


rdar://5297552

Thanks again,

-- Trenton


_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Informing HIToolbar of a size constraints change (From: Trenton Schulz <email@hidden>)
 >Re: Informing HIToolbar of a size constraints change (From: Eric Schlegel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.