[wxPython] Hard Grid Crash

Hard Grid Crash
wxPython 2.3.1 hybrid for Python 2.1

Win2k

ActivePython 2.1.1

Anyone know why this crashes hard when a key is pressed on the keyboard (try a-z)?

If the self.CreateGrid(0, 25) statement is changed to self.CreateGrid(1, 25), it works fine.

Thanks,

David.

Begin Code:

···

from wxPython.wx import *

from wxPython.grid import *

#---------------------------------------------------------------------------

class SimpleGrid(wxGrid):

    def __init__(self, parent, log):

        wxGrid.__init__(self, parent, -1)

        self.CreateGrid(0, 25)

#---------------------------------------------------------------------------

class TestFrame(wxFrame):

    def __init__(self, parent, log):

        wxFrame.__init__(self, parent, -1, "Simple Grid Demo", size=(640,480))

        grid = SimpleGrid(self, log)

#---------------------------------------------------------------------------

if __name__ == '__main__':

    import sys

    app = wxPySimpleApp()

    frame = TestFrame(None, sys.stdout)

    frame.Show(true)

    app.MainLoop()

#---------------------------------------------------------------------------

</details>

Anyone know why this crashes hard when a key is pressed on the keyboard

(try

a-z)?

If the self.CreateGrid(0, 25) statement is changed to self.CreateGrid(1,
25), it works fine.

If you were using the hybrid version you would get an invalid row index
assertion.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!