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 6657395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:45:46+00:00 2026-05-26T01:45:46+00:00

So I thought I had covered my bases, but apparently I’m missing a key

  • 0

So I thought I had covered my bases, but apparently I’m missing a key step or two.

I have an NSPanel that is displayed (makeKeyAndOrderFront:) when an NSStatusItem is pressed. Things work great, but as the NSPanel displays a title bar, the panel is also draggable. (This is undesired.)

The first screenshot shows the panel with “Title Bar” enabled in Interface Builder, in the Appearance category. (Sorry for the blur, things are still under lock and key for now.)

First screenshot

The only change that is made in Interface Builder is unchecking the “Title Bar” checkbox. I then save and re-run, and that’s what you see in the second screenshot. While a slight shadow appears, the panel does not.

enter image description here

Things I’ve tried:

  • I’ve subclassed the NSPanel and returned YES for canBecomeKeyWindow and canBecomeMainWindow after a bit of research, but (prior to subclassing) these methods both returned NO regardless of whether I was using a Title Bar or not. So I don’t think this is the issue.

  • I’ve ensured that the frame for the NSPanel is properly set. It has a good height, and the origin is set properly as well.

Edit: Forgot to Mention:

The application is a menu-bar-only application. In the screenshot below, note that an additional entry was added to Info.plist to enforce this.

Info Plist

  • 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-05-26T01:45:47+00:00Added an answer on May 26, 2026 at 1:45 am

    I’ve had problems with this in the past. I was able to resolve it by first “ignoring” other apps, then making it the key window. Give it a shot and see if it works for you.

    [NSApp activateIgnoringOtherApps:YES];
    [[self window]makeKeyAndOrderFront:self];
    

    Also, try setting the window level to NSPopUpMenuWindowLevel during initialization.

    [[self window]setLevel:NSPopUpMenuWindowLevel];
    

    I have also had problems with the way that nib files are loaded on Mac OS X. They’re loaded “lazily”, which means that they won’t be initialized until they’re needed. This causes a problem when you’re wanting to set specifics on the window, but you can’t because awakeFromNib doesn’t seem to be called, due to lazy nib loading. To fix this, here’s what I’ve done in the past. In your delegate (or wherever you initialize your window), kick the window into action by accessing the window property on the initialized class:

    wc = [[blah alloc]initWithWindowNibName:NSStringFromClass([blah class])];
    (void)[wc window]; //just kicks the lazy nib loading into gear
    

    By doing so, you’re forcing the nib to initialize. That way, when the user clicks the menubar icon the nib is already initialized, and awakeFromNib has already been called.

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

Sidebar

Related Questions

I thought I had this sorted, but I am still missing something. Very simply,
I thought I had this all figured out, but now that I'm writing a
I thought I had it but it seemed I was wrong. I have a
I thought I had this perfectly working but apparently not. I left my project
Ok, I thought I had this but I am not getting the results that
I thought I had it figured out but now I'm missing something. First I
I thought I had a pretty good handle on memory management for objective-c, but
I thought I had this figured out but it turns out I'm just deleting
Alright, I thought I had this whole setTimeout thing perfect but I seem to
can anyone help, i have problem doing a sort, I thought i had it

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.