wxMenuBar problems

Got a fun collection of command line output from running a script trying to assemble a menu on a Frame.

First telling me menu.AppendItem was deprecated and to use Append, once I switched to Append, it apparently is also deprecated.

Also the final item is that calling self.SetMenuBar(menubar) is not available. Using code from the demo.py files

Help!?!,

Leif

As shown in the docs, only the Append overload taking a wx.Menu is deprecated, use AppendSubMenu in that case.

Is self a wx.Frame?

Yes. subclassed:

class SimulatorMain(wx.Frame):

    ...other Components...

        menuBar = wx.MenuBar()
        menuBar.Append(fileMenu, "&File")
        menuBar.Append(helpMenu, "&Help")
        self.SetSize(400, 400)

        # Give the menu bar to the frame
        self.SetMenuBar(menuBar)

@Robin,

I found I was quite wrong in my approach. I was not wanting to append sub menus but simply menuItems to the main menu section. Now the SetMenuBar works, or stopped not working…

Thanks for your help,
Leif