hello i can`t work with this flatmenu i can`t put in top of window and
the managedwindow do you can help me i try to do like the example of
flatmenu in the pydocs
well this is my code
import wx
import wx.lib.agw.aui as waui
import wx.lib.agw.flatmenu as flm
class Frame(wx.Frame):
def __init__(self, parent, id):
wx.Frame.__init__(self, parent, id)
self.mgr = waui.AuiManager()
self.mgr.SetManagedWindow(self)
self.CreateMenu()
panel = wx.Panel(self, -1)
btn = wx.Button(panel ,-1, "Hello", (15, 12), (100, 120))
m_sz = wx.BoxSizer(wx.VERTICAL)
m_sz.Add(self.menubar, 0, wx.EXPAND)
m_sz.Add(panel, 1, wx.EXPAND)
self.SetSizer(m_sz)
m_sz.Layout()
self.mgr.AddPane(panel, waui.AuiPaneInfo().Name
("panel1").CenterPane())
self.menubar.PositionAUI(self.mgr) #here if i write this line
give me error if not the menu does`nt show of all
self.mgr.Update()
def CreateMenu(self):
self.menubar = flm.FlatMenuBar(self, -1)
f_menu = flm.FlatMenu()
e_menu = flm.FlatMenu()
v_menu = flm.FlatMenu()
t_menu = flm.FlatMenu()
w_menu = flm.FlatMenu()
#append f_menu
f_menu.Append(-1, "Abrir\tCtrl+N", "Text", None)
e_menu.Append(-1, "Abrir", "Text", None)
v_menu.Append(-1, "Abrir", "Text", None)
t_menu.Append(-1, "Abrir", "Text", None)
w_menu.Append(-1, "Abrir", "Text", None)
#append menus to menubar
self.menubar.Append(f_menu, "&Archivo")
self.menubar.Append(e_menu, "&Edicion")
self.menubar.Append(v_menu, "&Ver")
self.menubar.Append(t_menu, "&Herramientas")
self.menubar.Append(w_menu, "&Ventanas")
app = wx.App()
Frame(None, -1).Show()
app.MainLoop()
and this the error
Traceback (most recent call last):
File "C:\Documents and Settings\oskarp\Mis documentos
\NetBeansProjects\latest\src\main.py", line 59, in <module>
Frame(None, -1).Show()
File "C:\Documents and Settings\oskarp\Mis documentos
\NetBeansProjects\latest\src\main.py", line 29, in __init__
self.menubar.PositionAUI(self.mgr)
File "C:\Python26\lib\site-packages\wx-2.8-msw-ansi\wx\lib\agw
\flatmenu.py", line 1634, in PositionAUI
mgr.AddPane(self, pn)
File "C:\Python26\lib\site-packages\wx-2.8-msw-ansi\wx\lib\agw\aui
\framemanager.py", line 3907, in AddPane
return self.AddPane1(window, arg1)
File "C:\Python26\lib\site-packages\wx-2.8-msw-ansi\wx\lib\agw\aui
\framemanager.py", line 3949, in AddPane1
pinfo.buttons = []
TypeError: in method 'AuiPaneInfo_buttons_set', expected argument 2 of
type 'wxAuiPaneButtonArray'