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


Groups > comp.lang.python > #79299 > unrolled thread

OS X Menubar in Tkinter

Started byNoble Bell <noblebell@gmail.com>
First post2014-10-19 16:22 -0700
Last post2014-10-29 03:06 +1100
Articles 13 — 9 participants

Back to article view | Back to comp.lang.python


Contents

  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

#79299 — OS X Menubar in Tkinter

FromNoble Bell <noblebell@gmail.com>
Date2014-10-19 16:22 -0700
SubjectOS X Menubar in Tkinter
Message-ID<a876c046-18aa-4332-bc9a-b1d1181f2b4c@googlegroups.com>
I am using Python 3.4 on Mac OS X and Tinter 8.5. Does anyone have any code that they would share with me on how to remove the "Python" menu in the menubar at the top next to the "apple'? 

I would like to have the name of my program there instead and my menu. I can add menus but not sure how to do the special menubar. Any help would be appreciated.

NB

[toc] | [next] | [standalone]


#79300

FromNed Deily <nad@acm.org>
Date2014-10-19 17:49 -0700
Message-ID<mailman.14989.1413766161.18130.python-list@python.org>
In reply to#79299
In article <a876c046-18aa-4332-bc9a-b1d1181f2b4c@googlegroups.com>,
 Noble Bell <noblebell@gmail.com> wrote:
> I am using Python 3.4 on Mac OS X and Tinter 8.5. Does anyone have any code 
> that they would share with me on how to remove the "Python" menu in the 
> menubar at the top next to the "apple'? 
> 
> I would like to have the name of my program there instead and my menu. I can 
> add menus but not sure how to do the special menubar. Any help would be 
> appreciated.

The name that shows up in the menu is derived by OS X from the 
application name in the executing application bundle.  If you don't 
package your program up as an OS X application bundle, defaults will be 
used; in the case of Python OS X framework builds, Python provides a 
Python.app within the framework to allow the Python process to be 
automatically promoted to a full OS X gui process.  Probably the 
simplest approach is to use py2app to create a double-clickable app with 
the name you want.  There's an example in an answer to a similar 
question on Stackoverflow.  And there are some old but still relevant 
details documented in the Tcl/TkAqua FAQ.

https://pypi.python.org/pypi/py2app
http://stackoverflow.com/questions/8695926/remove-default-python-submenu-
with-tkinter-menu-on-mac-osx
http://wiki.tcl.tk/12987

-- 
 Ned Deily,
 nad@acm.org

[toc] | [prev] | [next] | [standalone]


#79305

FromGregory Ewing <greg.ewing@canterbury.ac.nz>
Date2014-10-20 19:47 +1300
Message-ID<cajpgcFe2rfU1@mid.individual.net>
In reply to#79300
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

[toc] | [prev] | [next] | [standalone]


#79314

FromNoble Bell <noblebell@gmail.com>
Date2014-10-20 03:47 -0700
Message-ID<45ced550-3ff2-4cc1-8592-6d1ca01caa8a@googlegroups.com>
In reply to#79300
On Sunday, October 19, 2014 7:49:34 PM UTC-5, Ned Deily wrote:
> In article <a876c046-18aa-4332-bc9a-b1d1181f2b4c@googlegroups.com>,
> 
>  Noble Bell <noblebell@gmail.com> wrote:
> 
> > I am using Python 3.4 on Mac OS X and Tinter 8.5. Does anyone have any code 
> 
> > that they would share with me on how to remove the "Python" menu in the 
> 
> > menubar at the top next to the "apple'? 
> 
> > 
> 
> > I would like to have the name of my program there instead and my menu. I can 
> 
> > add menus but not sure how to do the special menubar. Any help would be 
> 
> > appreciated.
> 
> 
> 
> The name that shows up in the menu is derived by OS X from the 
> 
> application name in the executing application bundle.  If you don't 
> 
> package your program up as an OS X application bundle, defaults will be 
> 
> used; in the case of Python OS X framework builds, Python provides a 
> 
> Python.app within the framework to allow the Python process to be 
> 
> automatically promoted to a full OS X gui process.  Probably the 
> 
> simplest approach is to use py2app to create a double-clickable app with 
> 
> the name you want.  There's an example in an answer to a similar 
> 
> question on Stackoverflow.  And there are some old but still relevant 
> 
> details documented in the Tcl/TkAqua FAQ.
> 
> 
> 
> https://pypi.python.org/pypi/py2app
> 
> http://stackoverflow.com/questions/8695926/remove-default-python-submenu-
> 
> with-tkinter-menu-on-mac-osx
> 
> http://wiki.tcl.tk/12987
> 
> 
> 
> -- 
> 
>  Ned Deily,
> 
>  nad@acm.org

Thank you. I will take a look at all that this afternoon. Seems like I might have seen that post on stack overflow but not for sure.

[toc] | [prev] | [next] | [standalone]


#79363

FromNoble Bell <noblebell@gmail.com>
Date2014-10-20 18:34 -0700
Message-ID<de8f5e9d-eb5e-4360-8d47-304fcbdd51df@googlegroups.com>
In reply to#79314
On Monday, October 20, 2014 5:47:14 AM UTC-5, Noble Bell wrote:
> On Sunday, October 19, 2014 7:49:34 PM UTC-5, Ned Deily wrote:
> 
> > In article <a876c046-18aa-4332-bc9a-b1d1181f2b4c@googlegroups.com>,
> 
> > 
> 
> >  Noble Bell <noblebell@gmail.com> wrote:
> 
> > 
> 
> > > I am using Python 3.4 on Mac OS X and Tinter 8.5. Does anyone have any code 
> 
> > 
> 
> > > that they would share with me on how to remove the "Python" menu in the 
> 
> > 
> 
> > > menubar at the top next to the "apple'? 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > I would like to have the name of my program there instead and my menu. I can 
> 
> > 
> 
> > > add menus but not sure how to do the special menubar. Any help would be 
> 
> > 
> 
> > > appreciated.
> 
> > 
> 
> > 
> 
> > 
> 
> > The name that shows up in the menu is derived by OS X from the 
> 
> > 
> 
> > application name in the executing application bundle.  If you don't 
> 
> > 
> 
> > package your program up as an OS X application bundle, defaults will be 
> 
> > 
> 
> > used; in the case of Python OS X framework builds, Python provides a 
> 
> > 
> 
> > Python.app within the framework to allow the Python process to be 
> 
> > 
> 
> > automatically promoted to a full OS X gui process.  Probably the 
> 
> > 
> 
> > simplest approach is to use py2app to create a double-clickable app with 
> 
> > 
> 
> > the name you want.  There's an example in an answer to a similar 
> 
> > 
> 
> > question on Stackoverflow.  And there are some old but still relevant 
> 
> > 
> 
> > details documented in the Tcl/TkAqua FAQ.
> 
> > 
> 
> > 
> 
> > 
> 
> > https://pypi.python.org/pypi/py2app
> 
> > 
> 
> > http://stackoverflow.com/questions/8695926/remove-default-python-submenu-
> 
> > 
> 
> > with-tkinter-menu-on-mac-osx
> 
> > 
> 
> > http://wiki.tcl.tk/12987
> 
> > 
> 
> > 
> 
> > 
> 
> > -- 
> 
> > 
> 
> >  Ned Deily,
> 
> > 
> 
> >  nad@acm.org
> 
> 
> 
> Thank you. I will take a look at all that this afternoon. Seems like I might have seen that post on stack overflow but not for sure.

Creating the app with py2app fixed my problem. 

[toc] | [prev] | [next] | [standalone]


#79368

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-10-21 06:58 +0100
Message-ID<mailman.15024.1413871135.18130.python-list@python.org>
In reply to#79363
On 21/10/2014 02:34, Noble Bell wrote:
>
> Creating the app with py2app fixed my problem.
>

I'm pleased to see that you have an answer.  In return would you please 
access this list via 
https://mail.python.org/mailman/listinfo/python-list or read and action 
this https://wiki.python.org/moin/GoogleGroupsPython to prevent us 
seeing double line spacing and single line paragraphs, thanks.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#79375

FromNoble Bell <noblebell@gmail.com>
Date2014-10-21 03:53 -0700
Message-ID<c8efbb8e-ece0-4e3f-aee5-25b7c3f67f62@googlegroups.com>
In reply to#79368
On Tuesday, October 21, 2014 12:59:08 AM UTC-5, Mark Lawrence wrote:
> On 21/10/2014 02:34, Noble Bell wrote:
 
> I'm pleased to see that you have an answer.  In return would you please 
> 
> access this list via 
> 
> https://mail.python.org/mailman/listinfo/python-list or read and action 
> 
> this https://wiki.python.org/moin/GoogleGroupsPython to prevent us 
> 
> seeing double line spacing and single line paragraphs, thanks.

I was not aware of the issue. Sorry. I will correct my posts in the future. Thanks for pointing it out to me.

NB

[toc] | [prev] | [next] | [standalone]


#79512

FromKevin Walzer <kw@codebykevin.com>
Date2014-10-23 09:25 -0400
Message-ID<m2avks$t48$1@dont-email.me>
In reply to#79368
On 10/21/14, 1:58 AM, Mark Lawrence wrote:
> I'm pleased to see that you have an answer.  In return would you please
> access this list via
> https://mail.python.org/mailman/listinfo/python-list or read and action
> this https://wiki.python.org/moin/GoogleGroupsPython to prevent us
> seeing double line spacing and single line paragraphs, thanks.

And admonitions of this type should be taken to 
comp.misc.propernntpformatting or 
groups.google.com/propergroupsformatting. They are OT for a list devoted 
to the Python programming language. I'd rather see flame wars over 
indenting vs. curly braces than this kind of constant policing of folks 
who come to us via Google: they greatly increase the noise I have to 
filter out.

-- 
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com

[toc] | [prev] | [next] | [standalone]


#79544

FromTerry Reedy <tjreedy@udel.edu>
Date2014-10-23 13:32 -0400
Message-ID<mailman.15115.1414085543.18130.python-list@python.org>
In reply to#79512
On 10/23/2014 9:25 AM, Kevin Walzer wrote:
> On 10/21/14, 1:58 AM, Mark Lawrence wrote:
>> I'm pleased to see that you have an answer.  In return would you please
>> access this list via
>> https://mail.python.org/mailman/listinfo/python-list or read and action
>> this https://wiki.python.org/moin/GoogleGroupsPython to prevent us
>> seeing double line spacing and single line paragraphs, thanks.
>
> And admonitions of this type should be taken to








> comp.misc.propernntpformatting or








> groups.google.com/propergroupsformatting. They are OT for a list devoted









> to the Python programming language. I'd rather see flame wars over








> indenting vs. curly braces than this kind of constant policing of folks









> who come to us via Google: they greatly increase the noise I have to







> filter out.

Kevin, feel free to filter out all of Mark's messages.  People posting 
from Google groups do not know that messages look like the above after a 
few rounds thru gg since gg apparently corrects its own misformatting in 
its displays.  Most people pay attention to Mark's information.  I 
ignore those who do not and send quad- or octo-spaced messages.

I have asked on python-list-admin that the same info be sent to new gg 
posters automatically and privately, or that the extra blanks be 
filtered out, but to no avail.

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#79545

FromChris Angelico <rosuav@gmail.com>
Date2014-10-24 06:02 +1100
Message-ID<mailman.15116.1414090947.18130.python-list@python.org>
In reply to#79512
On Fri, Oct 24, 2014 at 4:32 AM, Terry Reedy <tjreedy@udel.edu> wrote:
> I have asked on python-list-admin that the same info be sent to new gg
> posters automatically and privately, or that the extra blanks be filtered
> out, but to no avail.

I don't think it's possible to auto-solve the Google Groups formatting
issues at the mailing list level, as the fundamental problem is that
information isn't being transmitted. (Forcing everything to be wrapped
and forcing blank line removal risks breaking other formatting.) The
last time I had a job interview with Google, I said that I wanted to
spend my 20% time fixing Google Groups' paragraph handling... and then
they didn't hire me. Not sure if this is coincidental or not. :)

ChrisA

[toc] | [prev] | [next] | [standalone]


#79844

FromSimon Kennedy <sffjunkie@gmail.com>
Date2014-10-28 08:47 -0700
Message-ID<70233fcf-d51d-4dab-bff4-6f9911d319bf@googlegroups.com>
In reply to#79545
On Thursday, 23 October 2014 20:02:43 UTC+1, Chris Angelico  wrote:
> I don't think it's possible to auto-solve the Google Groups formatting
> issues at the mailing list level, as the fundamental problem is that
> information isn't being transmitted. (Forcing everything to be wrapped
> and forcing blank line removal risks breaking other formatting.) The
> last time I had a job interview with Google, I said that I wanted to
> spend my 20% time fixing Google Groups' paragraph handling... and then
> they didn't hire me. Not sure if this is coincidental or not. :)
> 
> ChrisA

Hopefully something may be happening...

https://productforums.google.com/d/msg/apps/4WQcWWajjvU/0NF7JgezGS0J

[toc] | [prev] | [next] | [standalone]


#79845

FromRustom Mody <rustompmody@gmail.com>
Date2014-10-28 08:59 -0700
Message-ID<ae2fee7f-7522-4fc9-9fd0-88be130f25ad@googlegroups.com>
In reply to#79844
On Tuesday, October 28, 2014 9:18:09 PM UTC+5:30, Simon Kennedy wrote:
> On Thursday, 23 October 2014 20:02:43 UTC+1, Chris Angelico  wrote:
> > I don't think it's possible to auto-solve the Google Groups formatting
> > issues at the mailing list level, as the fundamental problem is that
> > information isn't being transmitted. (Forcing everything to be wrapped
> > and forcing blank line removal risks breaking other formatting.) The
> > last time I had a job interview with Google, I said that I wanted to
> > spend my 20% time fixing Google Groups' paragraph handling... and then
> > they didn't hire me. Not sure if this is coincidental or not. :)
> > 
> > ChrisA
> 
> Hopefully something may be happening...
> 
> https://productforums.google.com/d/msg/apps/4WQcWWajjvU/0NF7JgezGS0J

Yay!
Seems to be fixed!

[Posted from GG without my usual post-processing filter. Ok??]

[toc] | [prev] | [next] | [standalone]


#79847

FromChris Angelico <rosuav@gmail.com>
Date2014-10-29 03:06 +1100
Message-ID<mailman.15263.1414512410.18130.python-list@python.org>
In reply to#79844
On Wed, Oct 29, 2014 at 2:47 AM, Simon Kennedy <sffjunkie@gmail.com> wrote:
> On Thursday, 23 October 2014 20:02:43 UTC+1, Chris Angelico  wrote:
>> I don't think it's possible to auto-solve the Google Groups formatting
>> issues at the mailing list level, as the fundamental problem is that
>> information isn't being transmitted. (Forcing everything to be wrapped
>> and forcing blank line removal risks breaking other formatting.) The
>> last time I had a job interview with Google, I said that I wanted to
>> spend my 20% time fixing Google Groups' paragraph handling... and then
>> they didn't hire me. Not sure if this is coincidental or not. :)
>>
>> ChrisA
>
> Hopefully something may be happening...
>
> https://productforums.google.com/d/msg/apps/4WQcWWajjvU/0NF7JgezGS0J

Wow! That'd be awesome. If they can properly wrap text and not
double-space, most of the GG issues would vanish.

ChrisA

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web