Updating wxComboBox Strings on the Fly

Why not delete it and create a new one?

···

-----Original Message-----
From: John W [mailto:jmw136@gmail.com]
Sent: Wednesday, October 05, 2005 10:18 AM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Re: Updating wxComboBox Strings on the Fly

No, I have a list of about 20 items that are default. Then processing occurs and I want the new list to be about 100 items.

The new list will still have the prior 20 items in it.

I was looking for an easy way to just clear the current list and then set a new one for a Combo Box without having to deal with individually inserting strings.

Thanks,

John
On 10/5/05, ** Franz Steinhäusler** <franz.steinhaeusler@gmx.at > wrote:

On Wed, 5 Oct 2005 09:22:34 -0500, John W <jmw136@gmail.com    > wrote:

Hello,

I have a Combo Box that is associated with a list on creation. It has about
20 default items in it.

The user can initiate some processing and as a result, the list associated
with the Combo Box grows to about 100 items.

However, what do I have to do to get my Combo Box to update its contents?

I would like to avoid having to do a Clear() and then appending each of my
new items in a loop.

Is there an easy way I can just reset the data for my Combo Box?

Thanks in advance,

John

Hello,

do you mean, not deleting all, but just a few one and adding others?

what about using:

Delete(self, n)
Deletes the item at the zero-based index ‘n’ from the control.

Insert(self, item, pos, clientData)
Insert an item into the control before the item at the pos index, optionally associating some data object with the item.

Append(self, item, clientData)
Adds the item to the control, associating the given data with the item if not None.


Franz Steinhaeusler


To unsubscribe, e-mail:     wxPython-users-unsubscribe@lists.wxwidgets.org

For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org