Customizing Quit MenuItem on macOS

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Customizing Quit MenuItem on macOS

Mat Kelly
I am running into an issue controlling the "Quit" menu when using wxPython 4.0.4 on macOS.

My application "FOO" has significance in the capitalization. By default, the "Application" menu, which is the name of the application on macOS and adjacent to the Apple menu, has a final entry whose text is "Quit Foo". Is there a way to change this menu item to instead say "Quit FOO"?

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Quit MenuItem on macOS

Mat Kelly
As a followup, one seemingly hacky approach I came up with was:

fooMenu = self.menu_bar.OSXGetAppleMenu()
for m in fooMenu.GetMenuItems():
  if m.GetId() ==  wx.ID_EXIT:
    m.SetText("Quit FOO\tCTRL+Q")

Is there a better way to control this value?

On Sunday, January 27, 2019 at 5:20:45 PM UTC-5, Mat Kelly wrote:
I am running into an issue controlling the "Quit" menu when using wxPython 4.0.4 on macOS.

My application "FOO" has significance in the capitalization. By default, the "Application" menu, which is the name of the application on macOS and adjacent to the Apple menu, has a final entry whose text is "Quit Foo". Is there a way to change this menu item to instead say "Quit FOO"?

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Customizing Quit MenuItem on macOS

Robin Dunn
That text should be coming from the app bundle's Info.plist file, but I don't know if it changes the case of that text or any other mods. If the name in the plist file is already uppercase and the os is still mangling it to "Foo" then what you've done is probably the best workaround.

-- Robin


On Sunday, January 27, 2019 at 2:37:12 PM UTC-8, Mat Kelly wrote:
As a followup, one seemingly hacky approach I came up with was:

fooMenu = self.menu_bar.OSXGetAppleMenu()
for m in fooMenu.GetMenuItems():
  if m.GetId() ==  wx.ID_EXIT:
    m.SetText("Quit FOO\tCTRL+Q")

Is there a better way to control this value?

On Sunday, January 27, 2019 at 5:20:45 PM UTC-5, Mat Kelly wrote:
I am running into an issue controlling the "Quit" menu when using wxPython 4.0.4 on macOS.

My application "FOO" has significance in the capitalization. By default, the "Application" menu, which is the name of the application on macOS and adjacent to the Apple menu, has a final entry whose text is "Quit Foo". Is there a way to change this menu item to instead say "Quit FOO"?

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.