can't set client data on wx.checkListBox

Hi All,

I would like to append client data on check list box

return core.ItemContainer_Append(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “wxAssertFailure” failed in …\src\msw\listbox.cpp(446): Can’t use client data with owner-drawn listboxes

is there a way to get around this…

cheers

···

Thomas Thomas

phone +64 7 855 8478
fax +64 7 855 8871

Hi All,

I would like to append client data on check list box

return _core_.ItemContainer_Append(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in
..\..\src\msw\listbox.cpp(446): Can't use client data with owner-drawn
listboxes

is there a way to get around this..

I don't think so, in the c++ source (msw/listbox.cpp) there are the
following comments:
    // for owner drawn objects, the data is used for storing wxOwnerDrawn
    // pointers and we shouldn't touch it

    // client data must be pointer to wxOwnerDrawn, otherwise we would crash
    // in OnMeasure/OnDraw

Ricardo

Thomas Thomas wrote:

Hi All,
I would like to append client data on check list box

return _core_.ItemContainer_Append(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ..\..\src\msw\listbox.cpp(446): Can't use client data with owner-drawn listboxes

is there a way to get around this..

No, the checklistbox on Windows uses the client-data slot to store the checked status of the item. You'll have to manage the association with data objects in some other way.

···

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