Windows problems

Hi list,

Again a compatibility problem Linux GTK and Windows. Python 2.3.3, wxPython
2.5.1.5 (and lots of other packages)

The following code runs fine on Linux.

--- snip ----

    def BldChoice(self):
        Groepen = Opendb.TableObjs.RegTable("ClientenGroepen").GetTable()
        self.t = {}
        n = 0
        for R in Groepen.select('').fetchall():
            self.Clientengroepenlist.Append(R.tab_naam,(R.tab_id,false))
            self.t[R.tab_id] = n
            n += 1

--- snip ----

But it gives me an assert on Win XP:

Traceback (most recent call last):
  File "/home/dick/Clienten/src/DefColumns.py", line 985, in ExecEdit
  File "/home/dick/Clienten/src/DefColumns.py", line 1010, in ExecOndh
  File "<string>", line 1, in ?
  File "C:\Program Files\Clienten\src\Ondclienten.py", line 13, in create
    return ClientenOnderhoudsscherm(action, parent, "Onderhoud
Clientgegevens")
  File "/home/dick/Clienten/src/GenScrn.py", line 797, in __init__
  File "C:\Program Files\Clienten\src\Ondclienten.py", line 28, in PanelDef
    return ClientenOnderhoudsPanel(action, self)
  File "C:\Program Files\Clienten\src\Ondclienten.py", line 98, in __init__
    self.UpdateData()
  File "C:\Program Files\Clienten\src\Ondclienten.py", line 104, in UpdateData
    if not self.operation == "Q": self.BldChoice()
  File "C:\Program Files\Clienten\src\Ondclienten.py", line 136, in BldChoice
    self.Clientengroepenlist.Append(R.tab_naam,(R.tab_id,false))
  File "C:\PROGRA~1\Python2.3\Lib\site-packages\wx\core.py", line 7976, in
Append
    return _core.ItemContainer_Append(*args, **kwargs)
wx.core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ..\..
\src\msw\listbox.cpp(467): Can't use client data with owner-drawn listboxes

Reading the manual I noticed the following remark:

This class is currently implemented under Windows and GTK. When using this
class under Windows wxWindows must be compiled with USE_OWNER_DRAWN set to 1.

I simply installed wxPython from the site on WIN-XP, so could it be that it is
compiled without this switch or is there another explanation.

Cheers,
D.Kniep

Dick Kniep wrote:

    return _core.ItemContainer_Append(*args, **kwargs)
wx.core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ..\..
\src\msw\listbox.cpp(467): Can't use client data with owner-drawn listboxes

Reading the manual I noticed the following remark:

This class is currently implemented under Windows and GTK. When using this class under Windows wxWindows must be compiled with USE_OWNER_DRAWN set to 1.

I simply installed wxPython from the site on WIN-XP, so could it be that it is compiled without this switch or is there another explanation.

On Windows the native client data value of the ListBox control is used to track the checked/unchecked status of the items in the wx.CheckListBox, so it unfortunately can't be used to hold your client data. This was brought up a few weeks ago on wx-dev and I think it was decided that this should be changed to track the checked status differently so client data can be allowed, but it hasn't been done yet.

···

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

On Tuesday 25 May 2004 19:15, Robin Dunn schreef:

On Windows the native client data value of the ListBox control is used
to track the checked/unchecked status of the items in the
wx.CheckListBox, so it unfortunately can't be used to hold your client
data. This was brought up a few weeks ago on wx-dev and I think it was
decided that this should be changed to track the checked status
differently so client data can be allowed, but it hasn't been done yet.

Ok Then I'll have to change my code....

A suggestion: I think it is very good to add a standard chapter to the
documentation of each command that describes the issues on platform
compatibility. I have been bitten on this several times the last few months,
so...

Cheers,
Keep up the good work!

Dick

Dick Kniep wrote:

On Tuesday 25 May 2004 19:15, Robin Dunn schreef:

On Windows the native client data value of the ListBox control is used
to track the checked/unchecked status of the items in the
wx.CheckListBox, so it unfortunately can't be used to hold your client
data. This was brought up a few weeks ago on wx-dev and I think it was
decided that this should be changed to track the checked status
differently so client data can be allowed, but it hasn't been done yet.

Ok Then I'll have to change my code....

A suggestion: I think it is very good to add a standard chapter to the documentation of each command that describes the issues on platform compatibility. I have been bitten on this several times the last few months, so...

We have a page in the wiki for it, but more in the docs would definitly be good.

···

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