Can some kind soul help a newbe with using the IsFullScreen method?
I would like set up a key (currently ESC) that toggles between full
screen and normal.
The code below chokes with the following when I press ESC.
Bigscreen = self.IsFullScreen()
AttributeError: MyFrame instance has no attribute 'IsFullScreen'
I am running with Python 2.1 and Windows 98 with wxPython 2.3
class MyFrame(wxFrame):
def __init__(self, parent, ID, title):
wxFrame.__init__(self, parent, ID, title,
wxDefaultPosition)
# self.CreateStatusBar()
# self.SetStatusText("This is the statusbar")
menu = wxMenu()
menu.Append(ID_ABOUT, "&About",
"XMS Test Program")
menu.AppendSeparator()
menu.Append(ID_EXIT, "E&xit", "Terminate the program")
menuBar = wxMenuBar()
menuBar.Append(menu, "&File");
self.SetMenuBar(menuBar)
aTable = wxAcceleratorTable([ (wxACCEL_NORMAL, WXK_ESCAPE,
ID_FULLTOGGLE) ])
self.SetAcceleratorTable(aTable)
EVT_MENU(self, ID_FULLTOGGLE, self.OnKeyPress)
EVT_MENU(self, ID_ABOUT, self.OnAbout)
EVT_MENU(self, ID_EXIT, self.TimeToQuit)
EVT_PAINT(self, self.OnPaint)
# EVT_CHAR(self, self.OnKeyPress)
EVT_KEY_DOWN(self, self.OnKeyPress)
def OnPaint(self, event):
dc = wxPaintDC(self)
dc.BeginDrawing()
dc.DrawRectangle(0,0,200,300)
dc.EndDrawing()
def OnAbout(self, event):
dlg = wxMessageDialog(self, "This program allows testing
of\n"
" the XMS.",
"About", wxOK | wxICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
def TimeToQuit(self, event):
self.Close(true)
def OnKeyPress(self, event):
# dlg = wxMessageDialog(self,"Escape Pressed")
# dlg.ShowModal()
# dlg.Destroy()
Bigscreen = self.IsFullScreen()
if Bigscreen:
self.ShowFullScreen(false)
else:
self.ShowFullScreen(true)
···
--
Richard A. Smith Bitworks, Inc.
rsmith@bitworks.com 501.846.5777
Sr. Design Engineer http://www.bitworks.com