[wxPython-users] GetDefaultEditorForType(): Unknown data type name []

Robin Dunn robin at alldunn.com
Wed Aug 1 13:44:11 PDT 2007


Petr Hlávka wrote:
> On 8/1/07, Petr Hlávka <petrhlavka at gmail.com> wrote:
>> On 7/31/07, Robin Dunn <robin at alldunn.com> wrote:
>>> Petr Hlávka wrote:
>>>> Hello,
>>>>
>>>> after migration from wxPython 2.6.3.2 to 2.8.4.0 (and Python 2.3 to
>>>> 2.5) I encounter strange errors when operating with grid in my app. I
>>>> have own GridBaseTable and some registered custom grid types (for bool
>>>> values). Sometimes (usually only for random cells) I've got an
>>>> exception:
>>>>
>>>> attr = wx.grid.GridCellAttr()
>>>> File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\grid.py", line 513,
>>>> in __init__
>>>> _grid.GridCellAttr_swiginit(self,_grid.new_GridCellAttr(*args, **kwargs))
>>>> wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed at ..\..\src\g
>>>> eneric\grid.cpp(10223) in wxGrid::GetDefaultEditorForType(): Unknown data type n
>>>> ame []
>>>>
>>>> The GetTypeName method always returns non-empty value so this error is
>>>> quite strange for me. I'm not able to send the whole code here and
>>>> when I try to cut off some snips, everything works correctly...
>>>>
>>>> Have anyone similar problems or could someone point me to the root of
>>>> the problem.
>>> I'll really need a runnable sample for this to be able to track it down.
>>>   The wxGrid code is just too big to keep it in my head, I need to look
>>> at a backtrace in the debugger.
>>>
>> I managed to create a simple app which demonstrates the problem (on
>> WinXP). When I click any of the unchecked checkbox I've got error
>> message described earlier (it's generated during the GridCellAttr()
>> call. Could someone please take a look on the code.
>>
> 
> It seems to be my fault, when I add CanGetValueAs/CanSetValueAs
> methods to GridTableBase everything is OK...

For the record this is a case of one assertion happening because of 
another, and then the 2nd one hides from you the first one which 
probably would have helped to diagnose this problem. The first one was:

wxGridCellBoolEditor::BeginEdit: invalid value for a cell with bool editor


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





More information about the wxpython-users mailing list