我想讓我的程序的top_panel只進入全屏,我希望有一個按鈕可以做到這一點,我面臨的問題是我不知道如何讓面板進入全屏自己而不用強制全幀進入全屏使用ShowFullscreen(真)wxpython面板全屏?
我希望你能幫助我
class top_panel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent=parent, size=(400,175))
self.SetBackgroundColour('BLACK')
self.ofullscreen = wx.Button(self, -1, "Fullscreen", (10,30))
self.ofullscreen.Bind(wx.EVT_BUTTON, self.onfullscreen, self.ofullscreen)
self.gbs = wx.GridBagSizer(2,2)
self.Bind(wx.EVT_KEY_DOWN, self.onKey)
wx.Frame.ShowFullScreen(True)
#----------------------------------------------------------------------
def onKey(self, event):
"""
Check for ESC key press and exit is ESC is pressed
"""
key_code = event.GetKeyCode()
if key_code == wx.WXK_ESCAPE:
self.GetParent().Close()
else:
event.Skip()
def onfullscreen(self):
print "hola"
#self.fullscreen?????
你有一個主框架,然後在某些事件你顯示面板,並希望它成爲一個全屏?你嘗試過嗎?你有什麼問題?也許這個功能只適用於TLW?請通過運行腳本發佈回溯。 – Igor