The script below behaves more or less as one
would expect, when the frame is resized.
However, if either of the commented lines
is uncommented, then the scroll bars remain,
no matter how large the frame is.
I say more or less because the scroll bars appear
even when the frame size exceeds the grid size
by perhaps 80 pixels in each dimension.
Is there some basic error in the code below?
Colin W.
from wxPython.wx import *
from wxPython.grid import *
class MyFrame(wxFrame):
def __init__(self,parent,id,title):
wxFrame.__init__(self,parent,id,title,wxPoint(-1,-1),(635,250))
# panel= wxPanel(self, -1)
grid = wxGrid(self,-1, wxPoint(40, 40), wxSize(530, 200))
grid.CreateGrid(5,5)
# EVT_SIZE(self, self.OnSize)
def OnSize(self, event):
print 'Frame Size:', event.GetSize()
class MyApp(wxApp):
def OnInit(self):
frame = MyFrame(None,-1,"wxGrid")
frame.Show(true)
self.SetTopWindow(frame)
return true
app = MyApp(0)
app.MainLoop()