Another (obscure) problem with grid cell editor

Frank Millman wrote:

I wanted to use keyboard shortcuts for the two icons. As far as I can

tell,

you cannot do this without adding a menu bar, but I found a neat (ugly?)
solution. I created two wxButtons, set up event handlers to invoke the

same

methods as the icons, and positioned them at (1000,1000), which is off

the

screen so they are invisible. I created an Accelerator Table to set up

the

shortcuts - Alt-P and Alt-N.

Robin Dunn wrote:

There is no need for the buttons. Using a wxAcceleratorTable will
deliver EVT_MENU events even if there is no menu. Just adding the
following in MyToolBar.__init__ is enough:

        EVT_MENU(panel, prev_id, panel.grid.OnPrev)
        EVT_MENU(panel, next_id, panel.grid.OnNext)

This is so neat - it has tidied up other areas of my code as well. Many
thanks.

[snip]

On both platforms, the crash occurs inside the NewPage() routine, at the
point where it is appending rows. If I comment out the calls to

NewPage(),

no errors occur.

Adding this to the begining of NewPage will probably help:

        if self.IsCellEditControlEnabled():
            self.DisableCellEditControl()

I don't understand it, but it works perfectly. Thanks very much.

Before 2.4.1.2 the only thing available with all version components is
the wxPython.wx.__version__ string. Starting with 2.4.1.2 you also have
a wxVERSION tuple and a wxVERSION_STRING string.

Thanks - I will try to remember it this time :slight_smile:

Frank