Re: [Boa Constr] Can choice control have dynamically generated options ?
Status: Beta
Brought to you by:
riaan
|
From: Werner F. B. <wer...@fr...> - 2009-04-01 14:47:28
|
Hi,
Tanay Shah wrote:
> Hello there,
>
> I want to know if it is possible to have the options in a wx.Choice
> control in a dynamic manner instead of the static options ?
> If it is possible then, how can I do it ?
I don't use Choice but ComboBox and as both use the same base (i.e.
ControlWithItems/ItemContainer) you should be able to do what I do.
Most of my ComboBox's are loaded when they receive focus or when another
control changes.
I then check if what is requested to be shown is already the same as
what the control already has in its list and then do nothing, otherwise
I do:
control.Clear()
.. get the items needed from the database
control.Append('item string', db.primarykey/s)
you could also use:
control.AppendItems(listOfStrings)
Werner
P.S.
This is more a wxPython then a Boa question, so for questions like this
you are most often better of asking it on:
wxp...@li...
|