Problem with Menu


#1

Hi,
I need to add couple of items to “application Name” menu which is created by the OS. I tried adding the items to main.nib but it doesn’t show up when the application is running.

         I used "static void setMacMainMenu (MenuBarModel *newMenuBarModel)" to display the menu in mac style.

       Does anybody know how do i solve my problem. Am currently using JUCE 1.45.

Regards,
Vishvesh


#2

As far as I can tell, this isn’t possible using Carbon, but as I’m currently rewriting all the mac stuff with Cocoa, I’ll probably be able to add this functionality in the future…


#3

According to mac standard “about Application” and “Preferences” should be displayed in Application Menu , these calls can put these two options in the Application Menu

EnableMenuCommand(NULL,kHICommandPreferences); for preferences option
EnableMenuCommand(NULL,kHICommandAbout); for about option

But the problem with this code is even if the options are selected, it doesn’t invoke “void menuItemSelected (int menuItemID, int topLevelMenuIndex)” , so am not able to handle the event.

Is there any fix for this.


#4

It wasn’t possible to do anything with that menu using Carbon, but once I’ve rewritten it all in Cocoa, all this should work…


#5

Hi Jules,
I just wanna know if it is now (since you have done the Cocoa code) possible to had items in this menu?

Thx,

Kevin


#6

Yes!


#7

Hi Jules,

Just wondering what the best way to get a callback from the applications main ‘app name’ menu is? We have a MenuBarModel which appears via a call to setMacMainMenu() which works fine, but we need a preferences and about item in the ‘appname’ menu, which we can add with the carbon function EnableMenuCommand(NULL,kHICommandPreferences);
but is there then a juce ‘approved’ way to handle the event received from that menu item?

Or is there an easier way to achieve overriding the main ‘appname’ menu too?

Thanks,

a


#8

The latest version in SVN has an extra parameter to setMacMainMenu for adding stuff to the app menu…