controls2c not in 2.5, GetColumn 2.4.1.2 typo workaround

I'm not really sure what to do about this one since I want to support 2.4.x
as well as 2.5.x. The only workable solution I see so far is to just require
2.4.2.4 since the typo was fixed by then. I'm just sending this to the list
since the issue may come up for someone else.

Apparently there was a typo in 2.4.1.2 which prevented GetColumn from
working correctly and I did a workaround using the controls2c module which
doesn't exist 2.5. My GetColumn method was used by the subclass, thus
avoiding the typo.

# KEA 2003-09-04
# workaround typo bug in wxPython 2.4.1.2 controls2.py
from wxPython.wx import controls2c

...

    # KEA 2003-09-04
    # workaround typo bug in wxPython 2.4.1.2 controls2.py
    def GetColumn(self, *_args, **_kwargs):
        val = controls2c.wxListCtrl_GetColumn(self, *_args, **_kwargs)
        if val is not None: val.thisown = 1
        return val

ka

Kevin Altis wrote:

I'm not really sure what to do about this one since I want to support 2.4.x
as well as 2.5.x. The only workable solution I see so far is to just require
2.4.2.4 since the typo was fixed by then. I'm just sending this to the list
since the issue may come up for someone else.

Apparently there was a typo in 2.4.1.2 which prevented GetColumn from
working correctly and I did a workaround using the controls2c module which
doesn't exist 2.5. My GetColumn method was used by the subclass, thus
avoiding the typo.

# KEA 2003-09-04
# workaround typo bug in wxPython 2.4.1.2 controls2.py
from wxPython.wx import controls2c

...

    # KEA 2003-09-04
    # workaround typo bug in wxPython 2.4.1.2 controls2.py
    def GetColumn(self, *_args, **_kwargs):
        val = controls2c.wxListCtrl_GetColumn(self, *_args, **_kwargs)
        if val is not None: val.thisown = 1
        return val

You could wrap the import in a try/except and then set a flag if there is an ImportError, and only define the method if the flag is not set.

···

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