I am trying to make my top_panel of my program go into fullscreen only, i hope to have a button which will do this, the issue i am faced with is i dont know how to make the pane
I have written about this subject on my blog. Here's an example:
import wx
class MyPanel(wx.Panel):
""""""
def __init__(self, parent):
"""Constructor"""
wx.Panel.__init__(self, parent)
self.Bind(wx.EVT_KEY_DOWN, self.onKey)
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()
class MyFrame(wx.Frame):
""""""
def __init__(self):
"""Constructor"""
wx.Frame.__init__(self, None, title="Test FullScreen")
panel = MyPanel(self)
self.ShowFullScreen(True)
if __name__ == "__main__":
app = wx.App(False)
frame = MyFrame()
app.MainLoop()
I have noticed that this code doesn't seem to work with Macs.