beipawel
beipawel

Reputation: 433

How to make an application with a window without decorators (no close, minimize, maximize buttons as well as no border)

I need to implement a simple Mac OS X application with a Webview in in. Sounds simple, but this app should have no border or titlebar nor should it have any buttons at the top like max/minimize and close. More like a Widget.

A plus would be if I could set up my own controls (I need to close it somehow after all).

Is this actually possible? If yes: how?

Note: I have no experience with mac apps whatsoever. I know principally how it's done, but actually I never did anything with it. I there's a problem to my posted solution though, I will learn what is necessary.

Upvotes: 2

Views: 1813

Answers (1)

Paige DePol
Paige DePol

Reputation: 1111

Yes, you can create windows with no decorations, in the interface builder portion of Xcode just uncheck Close, Minimize, Resize and Title Bar. This will leave you with a window that has no decorations but still has a drop shadow.

With this type of setup, however, you will not have any window controls, and if you add custom buttons to close the window they will not link up with your menu items for close, zoom or minimize.

Also, you will probably want to set the movableByWindowBackground property of your window to YES, otherwise the user will not be able to move it.

If you wish to have a custom window design (custom close, zoom, minimize buttons) with the ability to customize the titlebar, I would highly reccommend INAppStoreWindow[1] for the task. I am using it in my project to great effect!

[1]https://github.com/indragiek/INAppStoreWindow

Upvotes: 4

Related Questions