Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79305

Re: OS X Menubar in Tkinter

From Gregory Ewing <greg.ewing@canterbury.ac.nz>
Newsgroups comp.lang.python
Subject Re: OS X Menubar in Tkinter
Date 2014-10-20 19:47 +1300
Message-ID <cajpgcFe2rfU1@mid.individual.net> (permalink)
References <a876c046-18aa-4332-bc9a-b1d1181f2b4c@googlegroups.com> <mailman.14989.1413766161.18130.python-list@python.org>

Show all headers | View raw


Ned Deily wrote:
> The name that shows up in the menu is derived by OS X from the 
> application name in the executing application bundle.

I found a hackish way to change it at run time while
working on PyGUI, but it requires using PyObjC:

   from Foundation import NSBundle

   def change_application_name(new_name):
     #  Arrange for the application name to be used as the title
     #  of the application menu.
     ns_bundle = NSBundle.mainBundle()
       if ns_bundle:
         ns_info = ns_bundle.localizedInfoDictionary()
         if not ns_info:
           ns_info = ns_bundle.infoDictionary()
         if ns_info:
           if ns_info['CFBundleName'] == "Python":
             ns_info['CFBundleName'] = new_name

-- 
Greg

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

OS X Menubar in Tkinter Noble Bell <noblebell@gmail.com> - 2014-10-19 16:22 -0700
  Re: OS X Menubar in Tkinter Ned Deily <nad@acm.org> - 2014-10-19 17:49 -0700
    Re: OS X Menubar in Tkinter Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-10-20 19:47 +1300
    Re: OS X Menubar in Tkinter Noble Bell <noblebell@gmail.com> - 2014-10-20 03:47 -0700
      Re: OS X Menubar in Tkinter Noble Bell <noblebell@gmail.com> - 2014-10-20 18:34 -0700
        Re: OS X Menubar in Tkinter Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-21 06:58 +0100
          Re: OS X Menubar in Tkinter Noble Bell <noblebell@gmail.com> - 2014-10-21 03:53 -0700
          Re: OS X Menubar in Tkinter Kevin Walzer <kw@codebykevin.com> - 2014-10-23 09:25 -0400
            Re: OS X Menubar in Tkinter Terry Reedy <tjreedy@udel.edu> - 2014-10-23 13:32 -0400
            Re: OS X Menubar in Tkinter Chris Angelico <rosuav@gmail.com> - 2014-10-24 06:02 +1100
              Re: OS X Menubar in Tkinter Simon Kennedy <sffjunkie@gmail.com> - 2014-10-28 08:47 -0700
                Re: OS X Menubar in Tkinter Rustom Mody <rustompmody@gmail.com> - 2014-10-28 08:59 -0700
                Re: OS X Menubar in Tkinter Chris Angelico <rosuav@gmail.com> - 2014-10-29 03:06 +1100

csiph-web