wx.Choice.SetItems() - Is there a faster way?

Hello,

Hello,

I have to load about 5,000-10,000 values (maybe more) to a choice box at run time. It's a list that could keep growing....

The response time seems a little slower than I expected, considering how fast the other widgets seem to respond (maybe just my perception!?)

I've attached the code I am playing with - is there something I am doing wrong or is this just how fast I can expect this to be?

Thanks for your help!

Choice controls are really only meant to be used for holding up to a few dozen items. Putting that many in is way too much, and frankly quite unusable for the person that will be using the app to find the item in it. Should try to rethink how you are designing the ui. This issue is brought up on the list fairly often (to my memory anyhow), searching the archives might bring some more ideas.

Cody

···

On Jul 3, 2008, at 6:50 PM, list mail wrote:

I am rewriting an MS Access app in wxPython, and the client would like the screens to be very similar. The users asked for something like this, they think it’s usable…(see attached image)

I will search the archives, thanks. I would appreciate any suggestions!

Abi

···

On Thu, Jul 3, 2008 at 9:16 PM, Cody Precord codyprecord@gmail.com wrote:

Hello,

On Jul 3, 2008, at 6:50 PM, list mail wrote:

Hello,

I have to load about 5,000-10,000 values (maybe more) to a choice box at run time. It’s a list that could keep growing…

The response time seems a little slower than I expected, considering how fast the other widgets seem to respond (maybe just my perception!?)

I’ve attached the code I am playing with - is there something I am doing wrong or is this just how fast I can expect this to be?

Thanks for your help!

Choice controls are really only meant to be used for holding up to a few dozen items. Putting that many in is way too much, and frankly quite unusable for the person that will be using the app to find the item in it. Should try to rethink how you are designing the ui. This issue is brought up on the list fairly often (to my memory anyhow), searching the archives might bring some more ideas.

Cody

You could try making your own ChoiceList with wx.PopupWindow and
wx.ListCtrl(style = wxLC_VIRTUAL | wxLC_REPORT) Virtual list loads data as
scrollbar is used… this could be faster.

Mind that wx.PopupWindow will not work on Mac (should be
available in wxPython 2.9.* thought) (gtk and msw only).

From:
wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of list
mail

···

Sent: Friday, July 04, 2008 6:47 AM
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] wx.Choice.SetItems() - Is there a faster
way?

On Thu, Jul 3, 2008 at 9:16 PM, Cody Precord codyprecord@gmail.com wrote:

Hello,

On Jul 3, 2008, at 6:50 PM, list mail wrote:

Hello,

I have to load about 5,000-10,000 values (maybe more) to a choice box at run
time. It’s a list that could keep growing…

The response time seems a little slower than I expected, considering how fast
the other widgets seem to respond (maybe just my perception!?)

I’ve attached the code I am playing with - is there something I am doing wrong
or is this just how fast I can expect this to be?

Thanks for your help!

Choice controls are really only meant to be used for holding
up to a few dozen items. Putting that many in is way too much, and frankly quite
unusable for the person that will be using the app to find the item in it.
Should try to rethink how you are designing the ui. This issue is brought up on
the list fairly often (to my memory anyhow), searching the archives might bring
some more ideas.

Cody

I am rewriting an MS Access app
in wxPython, and the client would like the screens to be very similar. The
users asked for something like this, they think it’s usable…(see attached
image)

I will search the archives, thanks. I would appreciate any suggestions!

Abi

Vladiuz wrote:

You could try making your own ChoiceList with wx.PopupWindow and wx.ListCtrl(style = wxLC_VIRTUAL | wxLC_REPORT) Virtual list loads data as scrollbar is used… this could be faster.

Mind that wx.PopupWindow will not work on Mac (should be available in wxPython 2.9.* thought) (gtk and msw only).

Or make a custom popup for wx.combo.ComboCtrl.

But thousands of items in a control like that is still a bad idea from the UI and user experience perspective, so it would still be better to split it up somehow. For example, if the list could be divided into groups then there could be one choice or combo to select a group, which will then cause the next choice or combo to have that group's items loaded into it for selection, and so on for however many nested groups you can segment the items into.

If the items aren't groupable like that then there are other things that could be done.

···

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

i’ve no idea about solving the wx.Choice issue, but you can change:

self.SetCursor(wx.StockCursor(wx.CURSOR_WAIT))
self.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))
to
wx.BeginBusyCursor()
wx.EndBusyCursor()

···

2008/7/4 Robin Dunn robin@alldunn.com:

Vladiuz wrote:

You could try making your own ChoiceList with wx.PopupWindow and wx.ListCtrl(style = wxLC_VIRTUAL | wxLC_REPORT) Virtual list loads data as scrollbar is used… this could be faster.

Mind that wx.PopupWindow will not work on Mac (should be available in wxPython 2.9.* thought) (gtk and msw only).

Or make a custom popup for wx.combo.ComboCtrl.

But thousands of items in a control like that is still a bad idea from the UI and user experience perspective, so it would still be better to split it up somehow. For example, if the list could be divided into groups then there could be one choice or combo to select a group, which will then cause the next choice or combo to have that group’s items loaded into it for selection, and so on for however many nested groups you can segment the items into.

If the items aren’t groupable like that then there are other things that could be done.

Robin Dunn

Software Craftsman

http://wxPython.org Java give you jitters? Relax with wxPython!


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users