NSWindow Mac App Store like Title Bar - cocoa

How could I make an NSWindow's title bar look like that of the Mac App Store or of the app Feeder where it's height is increased and other controls are show in it.
To see what I mean just check out the website for the Mac App Store : http://www.apple.com/mac/app-store/.
Is it a custom NSWindow or is it a completely borderless window with an NSView made to look like the title bar?

https://github.com/indragiek/INAppStoreWindow
Title bar and traffic light customization for NSWindow
INAppStoreWindow is an NSWindow subclass that was originally developed to mimic the appearance of the main window in the Mac App Store application introduced in OS X 10.6.6.
The MAS application has since transitioned away from this design, but INAppStoreWindow is still being actively developed to provide extensive additional customization options for NSWindow title bars...

For iTunes (v9.x) Apple used no toolbar, but custom aligned icons and controls in the top bar, to achieve a similar effect. (see link below)
The window looks like a "textured & unified title and toolbar" window to me. (or a slight variant of such)
To reposition the traffic light buttons follow my answer to this question.
However, as Dave DeLong already (similarly) commented: "The UI is terrible. Please don't even think about it."

You can also take a look at http://orestis.gr/blog/2007/09/24/messing-with-windows/ . This uses some undocumented stuff, though, so it won't actually get approved FOR the App Store.

Related

How can you modify the styling of a compiled macOS app without the Xcode project and without additional apps?

Does anybody know, how to change the appearance of the title bar and/or toolbar of a simple & small one-window cocoa macOS application without accessing the Xcode or installing third party applications? It's for a screen recording video project, I want to do.
I know, that there are possibilities within the applications info.plist (for example changing the app title inside the top macOS Menu Bar) but I would like to be able to change the apps window title itself and/or colors and/or fonts inside the window title bar or toolbar if possible.
Opening the app in another container window or via terminal or Applescript and adding custom parameters or even an overlay in the right position to change the styling would be okay if this is possible?
Can somebody point me in the right direction?
Thank you very much!
in short: Nibs
Nib File Viewer works until Xcode 10
saving, recompiling if possible
good luck

Create a standard NSwindow with red, yellow and green buttons

Currently I am trying to create a standalone window which is triggered from pressing a drop down button in a status bar icon. I am able to create windows however I am unable to move, minimise or close the windwos and they have the missing red, oragne and yellow butons that are visible in Mac.
Any ideas how to fix?
Edit: to provide more details I am building a Status bar app. I have removed the default windows Views controller from Storyboard and create a new one to make up my "settings" Screen
( screenshot below)
I use the following code to instantiate the window -
let mainStoryboard = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil)
let myWindowController = mainStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "NewWindowVC")) as? NSWindowController
window?.windowController = myWindowController
and it results in the screen with no red, yellow and green buttons
whic isn't movable and doesn't have the buttons on it..
It sounds like you need an introduction to event & window handling under macOS. To get started try reading through the Cocoa Event Handling Guide and Windows Programming Guide which between them cover the principles of handling events and moving, resizing, closing windows in response. If you are opening "document" windows you might want to read Document-Based App Programming Guide for Mac as the document kit handles a lot of the mundane tasks. These are all found in Apple's Documentation Archive along with sample code, and many of these documents are referenced directly from the current API documentation.
Documentation Archive? All these are older guides and no longer being updated by Apple. You should check anything you read in them against the current API documents for the various classes, but the core hasn't changed a lot.
Another answer might reveal where Apple has hidden the up-to-date guides and sample code, but Apple's current documentation includes links back to these old ones...
If you fail to get your windows moving, closing etc. ask a new question showing your code and describing your problem and some will undoubtedly help you along.

How to prevent my macOS Menu Bar app from disappearing

I've been playing around with creating a Menu Bar app for macOS.
The app consists of an icon along with a title. The title displays additional context and can be dynamic width.
I've noticed that when the Menu Bar does not have enough room to display the icon AND context, it hides the whole app completely (icon and context) until there is space once again to show it.
Is it possible to prevent it from doing this somehow? Or at the very least maintain the icon visibility without the title, if room doesn't allow?
Unfortunately no, NSStatusItem lacks methods to indicate visibility or occlusion. The functionality you want might be possible via notification, but that is up to Apple to implement.
You may use two separate NSStatusItem. Looks like after creation they should be adjacent, until user reorders them with Cmd-drag.

Cocoa - XCode style notification window

Is the semi-transparant notification window which XCode 4 shows on Snow Leopard and on Lion a standard Cocoa control or is it something custom? I've seen more and more apps with similarly styled popups, and don't want to go about reinventing something if a much cleaner implementation exists in Cocoa. If this is a standard control, could someone tell me the name or point me to the documentation for it?
This is the popup window I am referring to:
This is custom but Matt Gemmell has sample code at http://mattgemmell.com/source. It's called RoundedFloatingPanel.

Displaying custom/arbitrary controls in an NSMenu

How can I Display an NSTextField or an NSProgressIndicator within an NSMenu? I'm looking to do something similar to the Spotlight icon menu, or the Help menu of most applications.
You can use the [NSMenu - setView:] method for it. But you can't add an NSTextField without major hacks. Apple still uses a brain dead Carbon implementation for menus. If you want keystrokes you have to go down into Carbon and do some magic for key handling.
Its so worse you will not even get a menu action fired if the user selects the menu item with the return key.
For this reason the official Apple sample just shows a slider as an embedded menu.
Please raise this topic on the official apple mailing list so Apple can see that this is a wanted feature and will be fixed soon.

Resources