4 small bugs in wxPython

Hallo,

herewith I report 4 minor bugs in wxPython.
OS are Windows XP, 98SE and Suse Linux 8.2

First:
When trying to set the PenWith of a Grid with
    self.SetCellHighlightPenWidth(2)

on Windows XP as well as 98SE
I get the following wxPython.wxc.wxPyAssertionError, while the same
code functions without Errormessage on Linux:

Traceback (most recent call last):
  File "/opt/doka/prg/cb/cbgrid.py", line 1397, in OnSetGridFocus
  File "C:\Python23\Lib\site-packages\wxPython\grid.py", line 1223, in
SetCellHighlightPenWidth
    val = gridc.wxGrid_SetCellHighlightPenWidth(self, *_args, **_kwargs)
wxPython.wxc.wxPyAssertionError: C++ assertion "uiIndex < m_nCount" failed in
e:\Projects\wx2.4\include\wx/dynarray.h(470)

I get this warning at least since about July 2003. It is still there with
the latest wxPython Windowsbuild 2.4.2.2 from Sourcforge. But it was not
there earlier this year.

Second:
An other bug(?) on Windows is, that pressing the Returnkey in a single
Line Textctrl (which in this case was part of a Modal Dialog) can only be
caught with an EVT_KEY_UP. Process-Enter, EVT_Char and EVT_KEY_DOWN
did not catch the Returnkey. On Linux at least EVT_Char works fine,
the others I did not try on Linux.

The third one:
On Linux, the latest Build from CVS (2.4.2.2) results in an assertion
because of a difference of the revision numbers. Seems to be wxPython
2.4.2.2 against wxWindows 2.4.2.1 or vice versa. This is a very new bug(?).
Here is the print out (inserted by me) and the errormessage:
wxRELEASE_VERSION: 2
wxc.wxRELEASE_VERSION: 1
/usr/lib/python2.3/site-packages/wxPython/wx.py:1643: UserWarning:
wxPython/wxWindows release number mismatch
  warnings.warn("wxPython/wxWindows release number mismatch")

The last one
A errormessage, which too does occour since summer is a
"Speicherzugriffsfehler" (in English 'Memoryaccesserror') when the
wxPythonprogramm (demo.py as well as my own programm) ends.

Regards
Christoph Becker

Christoph Becker wrote:

Hallo,

herewith I report 4 minor bugs in wxPython.
OS are Windows XP, 98SE and Suse Linux 8.2

First:
When trying to set the PenWith of a Grid with self.SetCellHighlightPenWidth(2)

on Windows XP as well as 98SE
I get the following wxPython.wxc.wxPyAssertionError, while the same
code functions without Errormessage on Linux:

Traceback (most recent call last):
  File "/opt/doka/prg/cb/cbgrid.py", line 1397, in OnSetGridFocus
  File "C:\Python23\Lib\site-packages\wxPython\grid.py", line 1223, in SetCellHighlightPenWidth val = gridc.wxGrid_SetCellHighlightPenWidth(self, *_args, **_kwargs)
wxPython.wxc.wxPyAssertionError: C++ assertion "uiIndex < m_nCount" failed in e:\Projects\wx2.4\include\wx/dynarray.h(470)

I get this warning at least since about July 2003. It is still there with
the latest wxPython Windowsbuild 2.4.2.2 from Sourcforge. But it was not
there earlier this year.

Call is with wxCallAfter. Probably the SetCellHighlightPenWidth is trying to do an Update but the grid isn't fully constructed or populated yet. (And the order of the events is slightly different on different platforms.)

Second:
An other bug(?) on Windows is, that pressing the Returnkey in a single
Line Textctrl (which in this case was part of a Modal Dialog) can only be
caught with an EVT_KEY_UP. Process-Enter, EVT_Char and EVT_KEY_DOWN
did not catch the Returnkey. On Linux at least EVT_Char works fine,
the others I did not try on Linux.

If I understand you correctly (if I don't please send a sample app) I think that the behaviour on Windows is the correct one. ENTER is used as a navigation key when the control is on a wxDialog or a wxPanel (it activates the default button if there is one) and so the normal key events are not sent. If you use the wxTE_PROCESS_ENTER style then it is supposed to generate EVT_TEXT_ENTER, but it is undefined whether or not the normal key events will happen in this case.

The third one:
On Linux, the latest Build from CVS (2.4.2.2) results in an assertion
because of a difference of the revision numbers. Seems to be wxPython
2.4.2.2 against wxWindows 2.4.2.1 or vice versa. This is a very new bug(?).
Here is the print out (inserted by me) and the errormessage: wxRELEASE_VERSION: 2
wxc.wxRELEASE_VERSION: 1
/usr/lib/python2.3/site-packages/wxPython/wx.py:1643: UserWarning: wxPython/wxWindows release number mismatch
  warnings.warn("wxPython/wxWindows release number mismatch")

This means that when you built wxPython it used (at least) the header files from a 2.4.1 installation of wxWindows. Did you not install the wxGTK from 2.4.2.4?

The last one
A errormessage, which too does occour since summer is a
"Speicherzugriffsfehler" (in English 'Memoryaccesserror') when the
wxPythonprogramm (demo.py as well as my own programm) ends.

Platform? I havn't seen anything like this in a long time, but it may be related to the above...

···

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