Re: NSWindow not restoring location
Re: NSWindow not restoring location
- Subject: Re: NSWindow not restoring location
- From: Brock Brandenberg <email@hidden>
- Date: Sat, 15 Jun 2002 12:29:41 -0500
Hi all.
I agree with Ondra that it's superfluous, but there is odd behavior when the
window occupies certain positions that makes it appear that its not working.
While I haven't figured it out 100%, it appears that if the window hangs off
screen at all, or if it overlaps the reserved space that could be occupied
by the dock (left, bottom or right regardless of whether or not the dock is
presently positioned there), the window controller will ignore the saved
frame position and show the window in the top left of the screen.
I use setFrameUsingName: inside windowDidLoad:, but do not use the
windowDidMove: method, and my palettes save and restore their locations
properly unless they previously overlapped the dock space or hung off the
screen. I don't like it, but that's what I'm seeing.
See if any of your windows match this behavior in these positions.
>
>>> - (void)windowDidMove: (NSNotification *)aNotification
>
>>> {
>
>>> [ [ self window ] saveFrameUsingName: @"Inspector" ];
>
>>> }
>
>>
>
>> This looks superfluous. Is it not in your setup?!?
>
>
>
> I think it is... the following method tells the window what its auto
>
> save name is. The key word is auto, every time the window is moved or
>
> resized its default will be updated.
>
>
>
> - (void)windowDidLoad
>
> {
>
> [ [ self window ] setFrameAutosaveName: @"Inspector" ];
>
> }
>
>
>
It should be superfluous, but there appears to be a bug in the window
>
frame autosave code. It saves the frame every time the window resizes,
>
but not when the window just moves. That's why it doesn't work for
>
non-resizable windows like most panels.
>
>
If I am wrong on this let me know. Perhaps it was fixed in Jaguar?
>
Brock Brandenberg
----- industrial design @ www.bergdesign.com ------
_______________________________________________
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.