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: Window title bar sliding under the menu bar



On 5/15/03 5:50 PM, Florent Pillet didst favor us with:

> Interestingly, I was hit by a similar problem this week in a PowerPlant
> application. The bug was in the way I was restoring the previous window
> position. Specifically, it was the way I was "forcing it on-screen". I
> was using ::ConstrainWindowToScreen() to compute a position then
> setting the window bounds. Now I use:
>
> void ForceOnScreen(LWindow* inWindow)
> {
> ThrowIfNULL_ (inWindow);
> Rect windowRect = {0,0,0,0};
> if (::ConstrainWindowToScreen (
> inWindow->GetMacWindow(),
> kWindowGlobalPortRgn,
> kWindowConstrainMayResize,
> NULL,
> &windowRect) == noErr)
> {
> inWindow->AdaptToBoundsChange(kWindowBoundsChangeUserDrag |
> kWindowBoundsChangeUserResize);
> }
> }
>
>
> Works much better... Anyway, the bug I was seeing was that the window
> was going up by a few pixel (usually the height of the menu bar). If
> that's what you're seeing, maybe it'll help you find the culprit.
>
FWIW, you can pass NULL in the last parameter since you aren't doing
anything with the result anyway.

Larry
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Window title bar sliding under the menu bar (From: Florent Pillet <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.