[wxPython-users] Adding Items to wx.ComboBox
Christopher Barker
Chris.Barker at noaa.gov
Fri Dec 22 13:25:48 PST 2006
It look like:
wx.ComboBox.Insert() is what you want
(inherited from wxControlWithItems)
-Chris
Rich Shepard wrote:
> I use a dialog box to get the values for some variables. When the "OK"
> button is clicked, those values are displayed in the appropriate widgets.
> Then, the "Save" button is clicked to write the record to the database
> table.
>
> One of these widgets is a wx.ComboBox(). I display the newly entered
> value
> using SetValue(). After saving the data and pressing the "Add" button to
> add
> a new value, the widgets displays are cleared and the newest set of values
> replace the previous ones. I want the values for this comboBox widget to
> accumulate in the list, rather than displaying one at a time.
>
> I bound EVT_TEXT to that widget, but must not have written the method
> correctly. When I try to add a second value, the system crashes with a seg
> fault.
>
> The demo shows how to work with a list of values already present, not how
> to add values. I'd appreciate some pointers on how to add to the list for
> that one widget as each new set of values is entered.
>
> Rich
>
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
More information about the wxpython-users
mailing list