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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:05:54+00:00 2026-05-15T05:05:54+00:00

I am writing a wxPython application that remains open after closing all of its

  • 0

I am writing a wxPython application that remains open after closing all of its windows – so you can still drag & drop new files onto the OSX dock icon (I do this with myApp.SetExitOnFrameDelete(False)).

Unfortunately if I close all the windows, the OSX menubar will only contain a “Help” menu. I would like to add at least a File/Open menu item, or just keep the menubar of the main window. Is this somehow possible in wxPython?

In fact, I would be happy with a non-wxPython hack as well (for example, setting the menu in pyobjc, but running the rest of the GUI in wxPython). wxPython development in OSX is such a hack anyway 😉

UPDATE: I managed to solve this problem using the tip from Lyndsey Ferguson. Here’s what I have done:

  • On startup I create a window which I show and hide immediately. I set its position to (-10000,-10000) so that it does not flicker on the screen (aargh, what a dirty hack!)
  • I create an empty EVT_CLOSE event handler in that window so that it cannot be closed.
  • It seems that destroying a window resets the OSX menu, but hiding does not… So when the last window is closed, I need to show and hide this window again (hiding is necessary so that the user cannot switch to this window using the Window menu or Cmd-`)

Yeah, this is really ugly… I will be very grateful if someone comes up with a prettier solution.

UPDATE 2: Actually it can be solved in a much easier way: if we do not close the last window, only hide it. And ensure that it does not respond to menu events anymore.

  • 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-15T05:05:55+00:00Added an answer on May 15, 2026 at 5:05 am

    Can you create a hidden window that is offscreen somewhere? It is a hack, but I remember having to do a lot of hacks to make my wxPython-based application work correctly on Mac OS X.

    Note:You’ll have to disable the close button and set up that hidden window so that it doesn’t show up in the Window menu.

    Aside:Have you considered factoring out your GUI portion of your Python application and using PyObjC on Mac OS X? You’ll get more native behaviours…

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

Sidebar

Related Questions

I'm writing a GUI application in Python using wxPython and I want to display
I'm coding the menu for an application I'm writing in python, using wxPython libraries
I am new to Python. I am writing an application using wxPython and I
I'm writing an application in wxPython. The button Plot shows the wxFrame with 3D
I´m writing an application for Android in which I have a character that I
Writing my first silverlight application. I need to deliver some bitmap that the customer
Writing an application for a custom gallery, and all the script files are put
Writing a JSP page, what exactly does the <c:out> do? I've noticed that the
Writing my first Linq application, and I'm trying to find the best way to
I am writing a small wxPython utility. I would like to use some event

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.