Maintaining window cascade when window size changes
Fabian Schuiki
fabianschuiki at bluewin.ch
Wed May 30 13:23:06 PDT 2007
Thanks Greg!
It took me about a day to find out that those nasty effects that
appeared if you had child windows with child windows :-D. Looks like
the WindowServer handles the parent's child window's child window
well when moving, but if the paren'ts child window's child window has
a child window too, that last window doesn't get moved. When you're
dragging the parent window, the child window's -frame method doesn't
return quite what you'd expect (it returns the frame before starting
the move).
I look forward to Leopard, hopefully Apple got some of this stuff
right (they had a plenty of time now).
So thanks again and all the best for you (and propably OmniFocus),
Fabian
Fabian Schuiki
fabianschuiki at bluewin.ch
Am 30.05.2007 um 17:27 schrieb Greg Titus:
>
> On May 29, 2007, at 11:07 AM, Fabian Schuiki wrote:
>
>> Hi,
>>
>> Question going to Omni: In your OmniInspector framework, how do
>> you tell your inspectors to stick together? When an inspector in
>> the middle of the cascade changes its size, all subsequent
>> inspectors stick to that inspectors bottom edge. How do you do that?
>
> Manually, for the most part. We register for
> NSWindowDidResizeNotification for the windows involved, and then
> when one of them is changed, we reposition every other window below
> it appropriately. The code is in OIInspectorGroup -
> controllerWindowDidResize: if you are interested in looking at the
> code.
>
> I initially attempted to write the code such that each inspector
> was a child window of the one above it, in the hopes that a lot of
> these manipulations would be automatically handled by the child
> window support in the window server, but at least in 10.3 and 10.4,
> AppKit really doesn't deal well with child windows that themselves
> have child windows. Just one level of parent and child is all that
> seems to be supported.
>
> So the only use of child windows now is that when you drag a group
> of inspectors, the topmost window is a parent and all of the
> windows under it are child windows of that top parent. This allows
> the window server to manage the dragging around of groups of
> windows automatically. But everything else is all done in our code.
>
> Hope this helps,
> - Greg
More information about the MacOSX-dev
mailing list