1

I created an application using Python 3.4 using tkinter. I'm using Py2App to create my .app file for deployment. All is working fine except I can't figure out how to get an about box to display from the top menu on the Mac. There is one that is coming from somewhere but it is about Tcl & Tk. I'm fine with leaving that one but I'd like my own to show as well. Here is the screenshot. I do have two tkinter menu widgets in my python app but they don't show anywhere either.

enter image description here

gbarnabic
  • 187
  • 2
  • 15
  • I know I managed this at some point by looking at the module `idlelib.macosxSupport`, it has quite the setup to `overrideRootMenu`, If I can remind myself how to accomplish it _without_ monkey patching idlelib and cherry picking the necessary functions, I'll post the answer. – Tadhg McDonald-Jensen Feb 26 '16 at 09:00
  • Possible duplicate of [Remove default "Python" submenu with Tkinter Menu on Mac OSX](http://stackoverflow.com/questions/8695926/remove-default-python-submenu-with-tkinter-menu-on-mac-osx) – Tadhg McDonald-Jensen Feb 26 '16 at 09:21
  • But I **know** it is possible otherwise because I use IDLE and it manages it... somehow... – Tadhg McDonald-Jensen Feb 26 '16 at 09:22

1 Answers1

3

You need to define a command tkAboutDialog to override the default About dialog that's shown by the Tk framework (and hence Python's Tk bindings).

You can do this as follows:

root.createcommand('tkAboutDialog', about_dialog)

Where root is the Tk object and about_dialog is a Python function that shows the about dialog.

For more information on OSX specific features of the Tk library see: http://tcl.tk/software/mac/features.tml

Ronald Oussoren
  • 2,715
  • 20
  • 29
  • Worked like a charm. I would have never figured that out by reading the docs you pointed to but simply adding that line of code and creating a simple def about_dialog(): function did the trick. – gbarnabic Feb 26 '16 at 17:00