wxpython ultimatelistctrl problem

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks

More details:
Windows 10 (1607)
Python 3.6.3
wxpython 4.0.0b2
My problem is clearly apparent in the 4.0.0b2 demo, clicking on an item in ultimatelistctrl (report or list view) returns:
Traceback (most recent call last):
File “agw\UltimateVirtualDemo.py”, line 87, in OnItemSelected
self.currentItem = event.Index
AttributeError: Index
or:
Traceback (most recent call last):
File “agw\UltimateReportDemo.py”, line 802, in OnItemDeselected
self.log.write(“OnItemDeselected: %d\n” % evt.Index)
AttributeError: Index
Traceback (most recent call last):
File “agw\UltimateReportDemo.py”, line 782, in OnItemSelected
self.currentItem = event.Index
AttributeError: Index

Basically the same error. Help!

Does event have an Index attribute? Is it possible it should be lower case “index”?

or should you be using event.GetEventObject().Index?

Just some thoughts…

···

On Nov 4, 2017, at 7:17 AM, floatingshed@gmail.com wrote:

More details:
Windows 10 (1607)
Python 3.6.3
wxpython 4.0.0b2
My problem is clearly apparent in the 4.0.0b2 demo, clicking on an item in ultimatelistctrl (report or list view) returns:
Traceback (most recent call last):
File “agw\UltimateVirtualDemo.py”, line 87, in OnItemSelected
self.currentItem = event.Index
AttributeError: Index
or:
Traceback (most recent call last):
File “agw\UltimateReportDemo.py”, line 802, in OnItemDeselected
self.log.write(“OnItemDeselected: %d\n” % evt.Index)
AttributeError: Index
Traceback (most recent call last):
File “agw\UltimateReportDemo.py”, line 782, in OnItemSelected
self.currentItem = event.Index
AttributeError: Index

Basically the same error. Help!

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

This is the wxpython demo, I haven’t made any changes or copied it elsewhere. I am actually running the demo.
Index (uppercase I) would seem to be correct as listctrl uses almost identical code, and that works but isn’t suitable for my purpose.
I have installed these versions of python and wxpython on three different machines, two versions of win10 and a win7 PC, same result on all.
I also tried with python 3.6.1, same result.

My project has stalled now. :frowning:

···

On Saturday, November 4, 2017 at 3:28:18 AM UTC, floati...@gmail.com wrote:

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks

Hi,

This is the wxpython demo, I haven’t made any changes or copied it elsewhere. I am actually running the demo.
Index (uppercase I) would seem to be correct as listctrl uses almost identical code, and that works but isn’t suitable for my purpose.
I have installed these versions of python and wxpython on three different machines, two versions of win10 and a win7 PC, same result on all.
I also tried with python 3.6.1, same result.

My project has stalled now. :frowning:

I think it’s a bug in the demo, introduced when it was ported from Classic to Phoenix. I’m not in front of a PC, can you try and use GetItemIndex instead of Index in the demo?

Andrea.

···

On Sat, 4 Nov 2017 at 22.12, floatingshed@gmail.com wrote:

On Saturday, November 4, 2017 at 3:28:18 AM UTC, floati...@gmail.com wrote:

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sorry, I meant GetIndex.

Andrea.

···

On Sun, 5 Nov 2017 at 05.28, Andrea Gavana andrea.gavana@gmail.com wrote:

Hi,

On Sat, 4 Nov 2017 at 22.12, floatingshed@gmail.com wrote:

This is the wxpython demo, I haven’t made any changes or copied it elsewhere. I am actually running the demo.
Index (uppercase I) would seem to be correct as listctrl uses almost identical code, and that works but isn’t suitable for my purpose.
I have installed these versions of python and wxpython on three different machines, two versions of win10 and a win7 PC, same result on all.
I also tried with python 3.6.1, same result.

My project has stalled now. :frowning:

I think it’s a bug in the demo, introduced when it was ported from Classic to Phoenix. I’m not in front of a PC, can you try and use GetItemIndex instead of Index in the demo?

Andrea.

On Saturday, November 4, 2017 at 3:28:18 AM UTC, floati...@gmail.com wrote:

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hello,
Thanks for helping.
Do you mean simply replace Index with GetIndex? That gives more errors:

self.ultimateList.GetItemText(self.currentItem),

File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 11385, in GetItemText
return self._mainWin.GetItemText(item)
File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 6331, in GetItemText
info = self.GetItem(info)
File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 8966, in GetItem
if item._itemId < 0 or item._itemId >= self.GetItemCount():
TypeError: ‘<’ not supported between instances of ‘method’ and ‘int’

I am fairly inexperienced in this, my aim is to learn from a working demo, I’m afraid I’m not adept enough to repair it first.
Thanks.

···

On Sunday, November 5, 2017 at 4:43:17 AM UTC, Infinity77 wrote:

Sorry, I meant GetIndex.

Andrea.

On Sun, 5 Nov 2017 at 05.28, Andrea Gavana andrea...@gmail.com wrote:

Hi,

On Sat, 4 Nov 2017 at 22.12, floati...@gmail.com wrote:

This is the wxpython demo, I haven’t made any changes or copied it elsewhere. I am actually running the demo.
Index (uppercase I) would seem to be correct as listctrl uses almost identical code, and that works but isn’t suitable for my purpose.
I have installed these versions of python and wxpython on three different machines, two versions of win10 and a win7 PC, same result on all.
I also tried with python 3.6.1, same result.

My project has stalled now. :frowning:

I think it’s a bug in the demo, introduced when it was ported from Classic to Phoenix. I’m not in front of a PC, can you try and use GetItemIndex instead of Index in the demo?

Andrea.

On Saturday, November 4, 2017 at 3:28:18 AM UTC, floati...@gmail.com wrote:

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi, what I meant is to replace this:

item.Index

With this:

item.GetIndex()

The demo should of course be fixed but I have very little time these days and I’m not a very good friend with git yet…

Andrea.

···

On Sun, 5 Nov 2017 at 08.44, floatingshed@gmail.com wrote:

Hello,
Thanks for helping.
Do you mean simply replace Index with GetIndex? That gives more errors:

self.ultimateList.GetItemText(self.currentItem),

File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 11385, in GetItemText
return self._mainWin.GetItemText(item)
File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 6331, in GetItemText
info = self.GetItem(info)
File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 8966, in GetItem
if item._itemId < 0 or item._itemId >= self.GetItemCount():
TypeError: ‘<’ not supported between instances of ‘method’ and ‘int’

I am fairly inexperienced in this, my aim is to learn from a working demo, I’m afraid I’m not adept enough to repair it first.
Thanks.

On Sunday, November 5, 2017 at 4:43:17 AM UTC, Infinity77 wrote:

Sorry, I meant GetIndex.

Andrea.

On Sun, 5 Nov 2017 at 05.28, Andrea Gavana andrea...@gmail.com wrote:

Hi,

On Sat, 4 Nov 2017 at 22.12, floati...@gmail.com wrote:

This is the wxpython demo, I haven’t made any changes or copied it elsewhere. I am actually running the demo.
Index (uppercase I) would seem to be correct as listctrl uses almost identical code, and that works but isn’t suitable for my purpose.
I have installed these versions of python and wxpython on three different machines, two versions of win10 and a win7 PC, same result on all.
I also tried with python 3.6.1, same result.

My project has stalled now. :frowning:

I think it’s a bug in the demo, introduced when it was ported from Classic to Phoenix. I’m not in front of a PC, can you try and use GetItemIndex instead of Index in the demo?

Andrea.

On Saturday, November 4, 2017 at 3:28:18 AM UTC, floati...@gmail.com wrote:

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I’m sorry I don’t understand. The line causing the problem is: self.currentItem = event.Index

Do you mean I should modify your original code or the scrip calling it?

Thanks.

···

On Sunday, November 5, 2017 at 7:48:32 AM UTC, Infinity77 wrote:

Hi, what I meant is to replace this:

item.Index

With this:

item.GetIndex()

The demo should of course be fixed but I have very little time these days and I’m not a very good friend with git yet…

Andrea.

On Sun, 5 Nov 2017 at 08.44, floati...@gmail.com wrote:

Hello,
Thanks for helping.
Do you mean simply replace Index with GetIndex? That gives more errors:

self.ultimateList.GetItemText(self.currentItem),

File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 11385, in GetItemText
return self._mainWin.GetItemText(item)
File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 6331, in GetItemText
info = self.GetItem(info)
File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 8966, in GetItem
if item._itemId < 0 or item._itemId >= self.GetItemCount():
TypeError: ‘<’ not supported between instances of ‘method’ and ‘int’

I am fairly inexperienced in this, my aim is to learn from a working demo, I’m afraid I’m not adept enough to repair it first.
Thanks.

On Sunday, November 5, 2017 at 4:43:17 AM UTC, Infinity77 wrote:

Sorry, I meant GetIndex.

Andrea.

On Sun, 5 Nov 2017 at 05.28, Andrea Gavana andrea...@gmail.com wrote:

Hi,

On Sat, 4 Nov 2017 at 22.12, floati...@gmail.com wrote:

This is the wxpython demo, I haven’t made any changes or copied it elsewhere. I am actually running the demo.
Index (uppercase I) would seem to be correct as listctrl uses almost identical code, and that works but isn’t suitable for my purpose.
I have installed these versions of python and wxpython on three different machines, two versions of win10 and a win7 PC, same result on all.
I also tried with python 3.6.1, same result.

My project has stalled now. :frowning:

I think it’s a bug in the demo, introduced when it was ported from Classic to Phoenix. I’m not in front of a PC, can you try and use GetItemIndex instead of Index in the demo?

Andrea.

On Saturday, November 4, 2017 at 3:28:18 AM UTC, floati...@gmail.com wrote:

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi,

···

On 5 November 2017 at 08:55, floatingshed@gmail.com wrote:

I’m sorry I don’t understand. The line causing the problem is: self.currentItem = event.Index

Do you mean I should modify your original code or the scrip calling it?

Thanks.

What I meant is: in the demo (which should obviously be fixed), instead of using:

self.currentItem = event.Index

Use:

self.currentItem = event.GetIndex()

You should do the same on your project.

Andrea.

On Sunday, November 5, 2017 at 7:48:32 AM UTC, Infinity77 wrote:

Hi, what I meant is to replace this:

item.Index

With this:

item.GetIndex()

The demo should of course be fixed but I have very little time these days and I’m not a very good friend with git yet…

Andrea.

On Sun, 5 Nov 2017 at 08.44, floati...@gmail.com wrote:

Hello,
Thanks for helping.
Do you mean simply replace Index with GetIndex? That gives more errors:

self.ultimateList.GetItemText(self.currentItem),

File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 11385, in GetItemText
return self._mainWin.GetItemText(item)
File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 6331, in GetItemText
info = self.GetItem(info)
File “C:\Python36\lib\site-packages\wx\lib\agw\ultimatelistctrl.py”, line 8966, in GetItem
if item._itemId < 0 or item._itemId >= self.GetItemCount():
TypeError: ‘<’ not supported between instances of ‘method’ and ‘int’

I am fairly inexperienced in this, my aim is to learn from a working demo, I’m afraid I’m not adept enough to repair it first.
Thanks.

On Sunday, November 5, 2017 at 4:43:17 AM UTC, Infinity77 wrote:

Sorry, I meant GetIndex.

Andrea.

On Sun, 5 Nov 2017 at 05.28, Andrea Gavana andrea...@gmail.com wrote:

Hi,

On Sat, 4 Nov 2017 at 22.12, floati...@gmail.com wrote:

This is the wxpython demo, I haven’t made any changes or copied it elsewhere. I am actually running the demo.
Index (uppercase I) would seem to be correct as listctrl uses almost identical code, and that works but isn’t suitable for my purpose.
I have installed these versions of python and wxpython on three different machines, two versions of win10 and a win7 PC, same result on all.
I also tried with python 3.6.1, same result.

My project has stalled now. :frowning:

I think it’s a bug in the demo, introduced when it was ported from Classic to Phoenix. I’m not in front of a PC, can you try and use GetItemIndex instead of Index in the demo?

Andrea.

On Saturday, November 4, 2017 at 3:28:18 AM UTC, floati...@gmail.com wrote:

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ok, thanks done that…
I am now getting the expected row data. Thanks.

There is still a problem though:

Traceback (most recent call last):
File “E:\Python\Scratch\UltimateReportDemo.py”, line 802, in OnItemDeselected
self.log.write(“OnItemDeselected: %d\n” % evt.Index)
AttributeError: Index
OnItemSelected: 7, Paula Abdul, Opposites
Attract, Rock

Thanks for all the help.

···

On Saturday, November 4, 2017 at 3:28:18 AM UTC, floati...@gmail.com wrote:

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks

There is still a problem though:

Traceback (most recent call last):
  File "E:\Python\Scratch\UltimateReportDemo.py", line 802, in
OnItemDeselected
    self.log.write("OnItemDeselected: %d\n" % evt.Index)

                                                ^^^^^^^^^

AttributeError: Index

  ^^^^^^^^^^^^^^^^^^^^^
...

item prints "self.currentItem = event.Index AttributeError: Index"

                                   ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
Karsten

···

On Sun, Nov 05, 2017 at 05:37:12AM -0800, floatingshed@gmail.com wrote:
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

I am new to this, I don’t know what you are telling me please use words instead of arrows.
I am just trying to get the demo to work, I’m really surprised that a demo doesn’t!

···

On Saturday, November 4, 2017 at 3:28:18 AM UTC, floati...@gmail.com wrote:

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks

What I was trying to point out is that you are seeing the
same problem, with near-identically worded messages. It is
quite likely that the solution Andrea provided works for
this instance, too.

Regards,
Karsten

···

On Sun, Nov 05, 2017 at 05:58:07AM -0800, floatingshed@gmail.com wrote:

I am new to this, I don't know what you are telling me please use words instead of arrows.

--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

Thanks, it eventually got into my brain, and I’ve sorted it!
Thanks everyone.

···

On Saturday, November 4, 2017 at 3:28:18 AM UTC, floati...@gmail.com wrote:

I can’t get ULC to getitem. Even in the demo (report version) clicking an item prints “self.currentItem = event.Index AttributeError: Index”
The code is identical to the standard wx.listctrl, it just doesn’t work in ultimate.
Any ideas?
Thanks