#
# Python 2.2.3, wxWindows/wxPython 2.4.1
#
# The code:
#
from wxPython.wx import *
class TestFrame( wxFrame ):
def __init__( self ):
wxFrame.__init__( self, None, -1, 'TestGrid' )
# the problem line >>> NameError: global name 'wxGrid' is not defined
grid = wxGrid( self, -1 )
grid.AppendCols( 2 )
grid.AppendRows( 3 )
grid.SetCellValue( 0, 0, 'Testing' )
self.Show( True )
return True
class TestApp( wxApp ):
def OnInit( self ):
frame = TestFrame()
self.SetTopWindow( frame )
return True
if __name__ == '__main__':
app = TestApp( 0 )
app.MainLoop()
#
# Any ideas?
#