Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding menu inactive for mouse action #2

Open
bearmountainbranch opened this issue May 5, 2016 · 3 comments
Open

Regarding menu inactive for mouse action #2

bearmountainbranch opened this issue May 5, 2016 · 3 comments
Labels

Comments

@bearmountainbranch
Copy link

bearmountainbranch commented May 5, 2016

If you want the menubar to be clickable you need to come up with some C-variant of this:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
  // [NSApp activateIgnoringOtherApps:YES] needs to be called after everthing
  // has finished launching, or else the menu bar will not work until we switch
  // applications once.
  // http://stackoverflow.com/questions/33345686/cocoa-application-menu-bar-not-clickable
  [NSApp activateIgnoringOtherApps:YES];
}

In which I mean, you need to figure out when you should call this.

@jimon
Copy link
Owner

jimon commented May 5, 2016

It's already called here https://github.com/jimon/osx_app_in_plain_c/blob/master/main.c#L279-L280 👍
Considering #1 looks like we just forgot a bundle and .plist to make it work in all cases.

@bearmountainbranch
Copy link
Author

Bundle is nice of course, however, I think it should be possible to have a functional executable and a functional menubar without bundle and .plist. I have a (somewhat) minimal objective c program which I can run from terminal, without plists and bundle, and still have a proper menu.

So if you really want to be minimal, I think it's doable, but I don't know how. Do what you will with the information :)

@DHowett
Copy link

DHowett commented May 6, 2016

It was once possible to "bundle" by embedding an Info.plist into your binary directly. It might be worth a shot:
CFLAGS += -Wl,-sectcreate,__TEXT,__info_plist,path/to/Info.plist

@jimon jimon added the bug label May 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants