Re: SetLevel: window and drawers
Re: SetLevel: window and drawers
- Subject: Re: SetLevel: window and drawers
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 23 Dec 2002 14:03:02 -0500
on 02-12-23 1:15 PM, Douglas Davidson at email@hidden wrote:
>
If you absolutely have to deal with a drawer's window, I'd suggest
>
asking the drawer's content view for its window. The drawer's window
>
is kept private to give us some freedom of implementation, but no
>
matter how we implement it the content view has to live in some window.
Excellent suggestion. I'll do that.
>
I took a look at drawer window levels once before Jaguar, but it's
>
possible there are still some remaining issues here. I'll look into it.
When switching the parent window (panel) from floating to normal level while
the drawers are closed, I can almost completely eliminate flickering by
explicitly setting the level of the drawerWindows to normal BEFORE setting
the level of the parent window to normal. This hides them behind the parent
window before it retreats to normal level. I can achieve the same result by
calling orderOut:nil on the drawerWindows before setting the level of the
parent window to normal. Cocoa takes care of making them visible again at
the appropriate time.
When setting the parent window's level to floating, however, I must use the
orderOut: technique. I obviously can't make the drawerWindows float first
because that makes them visible on top of the parent window. Using orderOut:
almost eliminates the flicker.
The remaining problem is this: If I move the parent window after changing
the level of everything, and then change its level again, the drawers become
visible at their old location (namely, where the parent window used to be
located). I can see them pop into visibility there the moment I click my
user control to change the level of the parent window. Although I can hide
them as quickly as possible with orderOut:, there is a brief moment when the
drawers are fully visible onscreen in the wrong location. Since I have 3
drawers and all 3 of them might flash like this, the flash is actually quite
long.
I have been unable to deduce exactly what is going on in the Cocoa code. The
main problem appears to be that the act of changing the parent window's
level makes the drawerWindows visible as a side effect, and I see no way to
prevent it. You might be able to solve these problems by reordering the code
so that closed drawers are always invisible until the user opens them -- and
even then don't make them visible until after they have been repositioned
and re-leveled to match the current position and level of the parent window
(and making sure they remain layered behind the parent window when they are
brought to the parent window's level -- I've had problems with drawer's
appearing on top of the parent window the moment I click an open button). It
appears that my explicitly changing the level of the parent window somehow
disconnects the drawers for a little while, in terms of their location
relative to the parent window, their visibility, and their level.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.