Menu bar on OS X

373 views
Skip to first unread message

Evan Johnson

unread,
Jun 3, 2009, 10:27:08 AM6/3/09
to wxPython-users
Hello all --

I'm new here, newish to Python and completely new to wxPython. I've
got what is inevitably, I fear, a stupid question: I can't get a menu
bar to appear. At all. Even demo.py doesn't show a menu bar when it
should, and this boilerplate demo code also doesn't show a menu bar
(although all other elements are in place):

----

#!/usr/bin/python
import wx
ID_ABOUT = 101
ID_EXIT = 110

class MainWindow(wx.Frame):
def __init__(self,parent,id,title):
wx.Frame.__init__(self,parent,wx.ID_ANY,title,size = (400,
200),style = wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
self.control = wx.TextCtrl(self,1,style = wx.TE_MULTILINE)

self.CreateStatusBar()
self.SetStatusText("Hello there")

filemenu = wx.Menu()
filemenu.Append(ID_ABOUT, "&About", "Information about this
program.")
filemenu.AppendSeparator()
filemenu.Append(ID_EXIT, "E&xit", "Terminate the program.")

menubar = wx.MenuBar()
menubar.Append(filemenu, "&File")
self.SetMenuBar(menubar)

self.Show(True)

app = wx.PySimpleApp()
frame = MainWindow(None, -1, "Small Editor")

app.MainLoop()

---

I'm on OS X 10.5.7, Python 2.5.2, wxPython 2.8.10.1. It occurs to me
I might have a version compatibility problem -- is this so?

Thanks in advance!

EJ

Robin Dunn

unread,
Jun 4, 2009, 12:42:54 AM6/4/09
to wxPytho...@googlegroups.com
Evan Johnson wrote:
> Hello all --
>
> I'm new here, newish to Python and completely new to wxPython. I've
> got what is inevitably, I fear, a stupid question: I can't get a menu
> bar to appear. At all. Even demo.py doesn't show a menu bar when it
> should, and this boilerplate demo code also doesn't show a menu bar
> (although all other elements are in place):

Don't take this the wrong way but are you aware that the menubar will
not be in the frame on Mac? Since it's a native app then the menubar
will be at the top of the screen like any other native Mac app.


--
Robin Dunn
Software Craftsman
http://wxPython.org

Evan Johnson

unread,
Jun 4, 2009, 9:55:12 AM6/4/09
to wxPython-users

On Jun 4, 12:42 am, Robin Dunn <ro...@alldunn.com> wrote:

> Don't take this the wrong way but are you aware that the menubar will
> not be in the frame on Mac?  Since it's a native app then the menubar
> will be at the top of the screen like any other native Mac app.
>
> --
> Robin Dunn
> Software Craftsmanhttp://wxPython.org


I will not take it the wrong way; I will merely realize that I am
an absolute moron. Thanks for pointing out the obvious -- my question
was even more foolish than I realized!

Best
EJ

pherrm...@gmail.com

unread,
May 23, 2017, 2:38:33 AM5/23/17
to wxPython-users, wxPytho...@googlegroups.com
i had the same problem lol!
Reply all
Reply to author
Forward
0 new messages