Window with frameAutosaveName moving
Window with frameAutosaveName moving
- Subject: Window with frameAutosaveName moving
- From: Andrew Merenbach <email@hidden>
- Date: Sun, 15 Jul 2007 11:09:58 -0700
Hi, all,
My program has a window that uses a frameAutosaveName, but also has a
toolbar where, when various selectable items are chosen, will resize
the window to fit the corresponding aspect.
When I disable my window-resizing code, the window always appears in
the same place upon program reopening. When I enable the code,
however, upon each successive launch the window appears below where
it was before (i.e., at a different y-coordinate), but at the same x-
coordinate. This occurs even if I don't move the window before
quitting--just opening and quitting, then reopening, causes this.
Does anyone have any tips on how to avoid this issue? For the
record, the code that I'm using for window-resizing is:
- (void)resizeToSize:(NSSize)newSize
{
NSRect aFrame;
float newHeight = newSize.height;
float newWidth = newSize.width;
aFrame = [self contentRectForFrameRect:[self frame]];
aFrame.origin.y += aFrame.size.height;
aFrame.origin.y -= newHeight;
aFrame.size.height = newHeight;
aFrame.size.width = newWidth;
aFrame = [self frameRectForContentRect:aFrame];
[self setFrame:aFrame display:YES animate:YES];
}
Cheers,
Andrew
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden