wx python窗口可以';不要隐藏我的菜单栏
Yop,一切都在标题中,我想在我的软件上隐藏我的wx.MenuBar(),这在我的Ubuntu上运行得很好,但当我在Windows上切换我的软件时,我的wx.MenuBar()并没有隐藏。。。有什么想法吗wx python窗口可以';不要隐藏我的菜单栏,python,wxpython,Python,Wxpython,Yop,一切都在标题中,我想在我的软件上隐藏我的wx.MenuBar(),这在我的Ubuntu上运行得很好,但当我在Windows上切换我的软件时,我的wx.MenuBar()并没有隐藏。。。有什么想法吗 menuBar = wx.MenuBar() self.fileMenu = wx.Menu() i = self.fileMenu.Append(-1, _("Load Model\tCTRL+L")) self.Bind(wx.EVT_MENU, self.
menuBar = wx.MenuBar()
self.fileMenu = wx.Menu()
i = self.fileMenu.Append(-1, _("Load Model\tCTRL+L"))
self.Bind(wx.EVT_MENU, self.showLoadModel(), i)
menuBar.Append(self.fileMenu, 'File')
self.SetMenuBar(menuBar)
menuBar.Hide()
编辑:那么,如果没有EVT_菜单,我如何捕捉CTRL+L?没关系,我找到了:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wx
class Example(wx.Frame):
def __init__(self, *args, **kw):
super(Example, self).__init__(*args, **kw)
self.InitUI()
def InitUI(self):
pnl = wx.Panel(self)
pnl.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
pnl.SetFocus()
self.SetSize((250, 180))
self.SetTitle('Key event')
self.Centre()
self.Show(True)
def OnKeyDown(self, e):
key = e.GetKeyCode()
if key == wx.WXK_ESCAPE:
ret = wx.MessageBox('Are you sure to quit?', 'Question',
wx.YES_NO | wx.NO_DEFAULT, self)
if ret == wx.YES:
self.Close()
def main():
ex = wx.App()
Example(None)
ex.MainLoop()
我想它不能藏在窗户里。不太确定。