Ferio
Ferio

Reputation: 516

Minimalist cocoa app, how to create a menu bar?

I’m just trying to create a window in cocoa. I wanted to use this code as a basis but somehow the app menu does not show up (still shows the one from the terminal, un-clickable though).

Can anybody give me a hint what might have changed in cocoa since that article was written? I’m using Yosemite.

Upvotes: 0

Views: 129

Answers (1)

Joshua Nozzi
Joshua Nozzi

Reputation: 61238

It works fine for me, but I had to Cmd-Tab switch away and back again to the running executable before the app menu became active. I tried appending a space and the ampersand symbol to the end of the code, which tells the shell to background the task, thinking it may launch normally then, but to no avail.

You might try appending an AppleScript command such as tell application MinimalistCocoaApp to activate after the command to launch ./MinimalistCocoaApp (separated by a semicolon). I'm not sure the "compile and run" terminal command for AppleScript, but that should be easily Googled.

Upvotes: 1

Related Questions