Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8706579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:38:53+00:00 2026-06-13T03:38:53+00:00

I’m working on getting a Status icon with a menu to appear in the

  • 0

I’m working on getting a Status icon with a menu to appear in the Mac OS Status Bar, as part of an NPAPI Chrome browser plugin.

Firebreath uses C++, while most of the libraries for Mac OS development utilize Objective C. I overcame that hurdle thanks to the response on this question. I also had to adjust my CMake settings in order to compile an XIB file to NIB.

After trial and error, I was able to get the status bar option to appear in the status bar, but when I click on it, the menu will not expand. I’m not sure what I need to do to get the menu to display. It works in a Cocoa application, but not in the Firebreath application.

I’ve imported the Foundation and Cocoa libraries as well.

I suspect the problem is either in my MainMenu.xib file or in AppDelegate.m.

AppDelegate.m:

#import "AppDelegate.h"   

@implementation AppDelegate

-(void)awakeFromNib {
    NSLog(@"calling awakeFromNib...");

    NSStatusBar *bar = [NSStatusBar systemStatusBar];
    statusItem = [[bar statusItemWithLength:NSVariableStatusItemLength ] retain];


   // statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
    //[statusItem retain];
    NSMenuItem *menuItem;


    menuItem = [[[NSMenuItem alloc] initWithTitle:@"Test" action:NULL keyEquivalent:@""] retain];
//    [menuItem setView: myView];
    statusMenu = [statusMenu initWithTitle:@"WTF"];
    [statusMenu addItem:menuItem];

    [menuItem retain];
    [statusItem setTitle: NSLocalizedString(@"StatusMenu",@"")];
    [statusItem setHighlightMode:YES];
    [statusItem setMenu:statusMenu];
    [statusItem setEnabled:YES];

    [statusMenu retain];

    // this was needed to get the icon to display
    [statusItem retain];
    //[window retain];
}

- (IBAction)settings:(id)sender {
    NSLog(@"Invoking the settings from the menu...");

}

//@synthesize window;
@end

This file was snagged from the sample app, and awakeFromNib is being invoked manually from an Objective C++ wrapper class. As per the logs, and the fact that I see “StatusMenu” in the Status Bar, I know this function is being called.

I also include a screenshot of the MainMenu.xib:

MainMenu.xib:

MainMenu.xib

The last thing I’ve tried is adding NSStatusItem as an IBOutlet to see if I can connect it to something in the xib file, but I’m not really sure this is the right direction to go.

What is it that needs to be done to get the menu to show when clicking the Status Menu option?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:38:54+00:00Added an answer on June 13, 2026 at 3:38 am

    The problem here is that the Firebreath project and the NPAPI plugin architecture don’t support automatic reference counting (ARC), which is generally turned on by default in XCode projects.

    Additionally, because of the craziness of mixing Objective C with C++, XCode isn’t really able to report on errors as easily as if the code was written purely in Objective C. Thus, the error message is suppressed. In order to avoid the errors, the developer working with the NPAPI plugin architecture must manage memory explicitly by invoking alloc on the NSMenu object.

    As long as alloc is called on these objects, they’ll be properly retained. This fixes the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a small JavaScript validation script that validates inputs based on Regex. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.