Menu bar on OS X

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

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

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

···

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 had the same problem lol!

···

On Wednesday, June 3, 2009 at 10:27:08 AM UTC-4, 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):


#!/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