wxTreeItemId: difference between classic and phoenix

Hello list.

In classic wxTreeItemId had a property m_pItem. In Phoenix this isn’t available anymore. What was it and how can i replace it?

I’m tying to convert an app to phoenix and there is a custom treecontrol where the property is used to send a windows message to the control to show a insert mark for DnD.

I hope someone can help me, thanks in advance.

···


Torsten

In classic wxTreeItemId had a property m_pItem. In Phoenix this isn't available anymore. What was it and how can i replace it?

The equivalent is probably the GetID method, as Phoenix uses SIP now instead of SWIG:

In Python 2.7 / Classic:

item.m_pItem

<Swig Object of type 'void *' at 0x3f28f0>

In Python 3.5 / Phoenix:

item.GetID()

<sip.voidptr object at 0x03DD3698>

Not sure whether this will help you for your purpose.

I'm currently working on wxGlade.
If you can solve the problem, example code would be welcome. I would like to implement Drag&Drop from the palette of controls to the tree view of the project. The standard methods for TreeCtrl seem quite limited...

Regards,

Dietmar

···

On 29.08.2016 20:52, 'Torsten' via wxPython-users wrote:

Thank you for the hint Dietmar,

not sure if it is realy correct, but i got it working. Instead of

long(treeItem.m_pItem)

``

i now use

long(eval(hex(treeItem.GetID())))

``

Now i need to search how to convert the hex string to long without eval. Later i will try to make small sample app.

···


Torsten

Am Montag, 29. August 2016 22:46:43 UTC+2 schrieb Dietmar Schwertberger:

On 29.08.2016 20:52, ‘Torsten’ via wxPython-users wrote:

In classic wxTreeItemId had a property m_pItem. In Phoenix this isn’t
available anymore. What was it and how can i replace it?

The equivalent is probably the GetID method, as Phoenix uses SIP now
instead of SWIG:

In Python 2.7 / Classic:

item.m_pItem

<Swig Object of type ‘void *’ at 0x3f28f0>

In Python 3.5 / Phoenix:

item.GetID()

<sip.voidptr object at 0x03DD3698>

Not sure whether this will help you for your purpose.

I’m currently working on wxGlade.

If you can solve the problem, example code would be welcome. I would
like to implement Drag&Drop from the palette of controls to the tree
view of the project. The standard methods for TreeCtrl seem quite limited…

Regards,

Dietmar

Using long is probably not too future-proof, as in Python 3 it’s not
available any more.
Have a look at the documentation at
Probably you can just convert it to int:

···

On 29.08.2016 23:15, ‘Torsten’ via wxPython-users wrote:

long(eval(hex(treeItem.GetID())))

``

      Now i need to search how to convert the hex string to long

without eval. Later i will try to make small sample app.

http://pyqt.sourceforge.net/Docs/sip4/python_api.html#sip.voidptr

_int__() →
integer
This returns the address as an integer.

Regards,

Dietmar