Re: Close/Minimize the app
Re: Close/Minimize the app
- Subject: Re: Close/Minimize the app
- From: Symadept <email@hidden>
- Date: Thu, 12 Nov 2009 12:48:17 +0800
Actually I wanted to hide the app when close button is closed such that it
shall be active still. Which I was doing. I was basically facing the problem
with Minimize the app. I don't know why the NSApp
miniaturizeAll:self<http://discussions.apple.com/>;
is not functioning as expected.
Regards
Symadept
On Thu, Nov 12, 2009 at 12:27 PM, Nick Zitzmann <email@hidden> wrote:
>
> On Nov 11, 2009, at 8:50 PM, Symadept wrote:
>
> > How to close/minimize the app programmatically.
>
> To close the app, call -[NSApplication terminate:].
>
> > I tried the following way
> > but no luck.
> >
> > [[NSApp mainWindow] performMiniaturize:nil];
>
> This will only miniaturize the main window, and it won't work if
> -mainWindow returns nil (e.g. the app is in the background).
>
> > [OR]
> > [NSApp miniaturizeAll:self];
>
> Now that should minimize all of the windows, unless you somehow
> circumvented loading NSApplication.
>
> > And close should not terminate my app, it should place an icon in the
> Dock,
> > I hope it would be the same. And I know to give Dock Menu items.
> >> From that menuitem, if I click on Open, it shall be able to launch my
> app.
>
> If an app is in the Dock, it is there because the app is running, or
> because the user wants to keep it in the Dock when it is not running. Please
> do not programmatically add inactive applications to the Dock. Even if there
> was an official way of doing this, Mac OS X has a long tradition of making
> this choice opt-in instead of opt-out like on Windows.
>
> Nick Zitzmann
> <http://www.chronosnet.com/>
>
>
>
>
_______________________________________________
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