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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:56:33+00:00 2026-05-22T14:56:33+00:00

I am building a StatusBar App in Cocoa, therefore I have no menu. Having

  • 0

I am building a StatusBar App in Cocoa, therefore I have no menu. Having no menu implies not having a “File > Close” menu item, which normally listens to the shortcut “Command + W”.

From my StatusBar App the user may open a window to change the preferences and that’s where I’m running into problems: The user can only close the window by pressing the red dot with the mouse. However, like alle applications I want to support the “Command + W” shortcut as well.

At the moment I see two possibilities to solve this issue:

  1. Place an invisible button on the window which listens to the shortcut.
  2. Add an application-wide listener for the shortcut and contact the window manually.

Both solutions feel like a misuse of the system. The first solution can lead to unexpected behaviour (the window closes if the user hits the invisible button by chance) and the second solution will still result in a beep, since the window does not know that it handles such a shortcut.

Is there an elegant way to solve this problem? Since the view should know what to do, a solution with just Interface Builder would be perfect. If there is no elegant way, is there a way to enhance the solutions mentioned?

Thanks in advance!

  • 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-22T14:56:33+00:00Added an answer on May 22, 2026 at 2:56 pm

    If you put a File > Close menu item in your MainMenu nib, the shortcut will work, even though the menu isn’t visible.

    If you choose to implement an app-wide listener for the shortcut instead, you can get rid of the beep by returning nil from the block, so that the original event doesn’t get passed on.

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

Sidebar

Related Questions

Building a Django app on a VPS. I am not very experienced with setting
I'm building an Application and it needs to have a status bar item and
Building an MVC 3 app with Razor and I have some information persisted in
I am building a Calendar app. I have Navigation based app template. Navigation controller
I am building a web app built on Spring MVC and Hibernate. I have
Building a Shopping Cart app. Some products have options, some don't. I visitor can
Building a lottery scratch-card app in Java. Have allot of it done, just need
Building an inventory system. I have lots of products and each product has three
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
I am building an application (without interface builder!) which 'lives' in the NSStatusBar; when

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.