Re: NSWindow remember whether showing on re-launch
Re: NSWindow remember whether showing on re-launch
- Subject: Re: NSWindow remember whether showing on re-launch
- From: Michael Babin <email@hidden>
- Date: Sat, 08 Feb 2014 09:52:27 -0600
On Feb 8, 2014, at 9:45 AM, Michael Babin <email@hidden> wrote:
> On Feb 7, 2014, at 11:43 PM, Roland King <email@hidden> wrote:
>
>> I have a window in my OSX application which shows a log of commands. It's not 'Visible At Launch' because you often don't need to see it. It's also excluded from the windows menu, instead it has its own permanent menu item on that menu which both shows if it's enabled and acts as a menu item to toggle it. All works fine.
>>
>> I want however the window to remember its state and if it was showing when the app was terminated, show on re-start. I can do that with a user default quite easily but figured this has to be a very common task and thought there must be a standard way to accomplish it. Is there?
>
> Have you read the section of the Mac App Programming Guide on UI preservation?
>
> User Interface Preservation
Well, that looked like a link when I pasted it in my original message but apparently did not get included or sent as such. Here it is again:
https://developer.apple.com/library/mac/documentation/General/Conceptual/MOSXAppProgrammingGuide/CoreAppDesign/CoreAppDesign.html#//apple_ref/doc/uid/TP40010543-CH3-SW26
>
> Also see the related reference items (NSWindowRestoration protocol, NSWindow and NSResponder classes). For standard window state (size, position, visible), I suspect the state preservation/restoration of NSWindow itself would suffice (as long as the window is restorable).
_______________________________________________
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