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

  • Home
  • SEARCH
  • 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 160101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:58:31+00:00 2026-05-11T10:58:31+00:00

In my small app for Mac OS X I display some info in system

  • 0

In my small app for Mac OS X I display some info in system menubar. I use

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

It works very nice and I can change the text with

[statusItem setTitle:[NSString stringWithString:@'Woo-hoo']]; 

But it uses the default menu font which is too big for my relatively unimportant info. So I decided to reimplement it with a custom view. I created a view in Interface Builder.

Unfortunately, however, when I set it as a view for my menu item with

[statusItem setView:myView]; 

it just displays a white bar in the menu instead of my thing. I tried to

[statusItem    drawStatusBarBackgroundInRect:[myView frame]   withHighlight:NO]; 

with no success.

In trying to figure out whether a problem is with the view itself or with the way I assign it to the menubar, I created a window and did

[myTestWindow setContentView:myView]; 

This one worked seamlessly. This makes me think my view is OK 🙂

So, what else can I try to make the menu item display my own view?

Thanks!

  • 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. 2026-05-11T10:58:32+00:00Added an answer on May 11, 2026 at 10:58 am

    It happened to be some weird side-effects of window-view autosizing setup in Interface Builder (let’s call them size-effects). In the Inspector you can setup how subviews get resized upon superview sizing. And so it was somehow broken in my case, such that when window gets small enough (menuitem-high), my elements just got drawn outside of the window’s frame.

    I re-configured the sizing in IB, eliminating all the automatics I don’t need, and now it works perfectly: the view from IB gets displayed inside a menu item.

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

Sidebar

Related Questions

I'm totally new to Mac OS and iPhone and I'm writing some small app.
I'm developing small FTP upload app. for mac (10.6 if it matters) Have problem
I am trying to write a small Mac command line app that can read
I have a small app that downloads some files from a remote (HTTP) server
I'm writing a small app to do a little processing on some cells in
I am coding a small app ,in middle i struck at some point where
I´m using Mac OS Lion, with java version 1.6.0_26 I'm making a small app
i've developed small web app for personal use with Ruby on Rails. Now when
I'm starting a Mac OS X app that will connect to a small website
I've written a small app to parse some RSS feeds from YouTube and launch

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.