populate wxchoice Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
rafae11
Experienced Solver
Experienced Solver
Posts: 85
Joined: Sat Jun 02, 2012 8:41 am

populate wxchoice

Post by rafae11 »

i have some items i need to populate a drop down list.

a01
a02

it can only be loaded after they have been detected.
how do i add the strings above into a wxchoice?

Code: Select all

m_Channel->SetString(0,channel.c_str());
m_Channel->SetString(1,channel.c_str());
the code i tried does not work could somebody let me know what i am doing wrong thanks.
Radek
Super wx Problem Solver
Super wx Problem Solver
Posts: 286
Joined: Sun Sep 11, 2011 7:17 am

Re: populate wxchoice

Post by Radek »

SetString() manipulates an existing item. If you want to populate the combobox then use Append() or Insert(). See wxControlWithItems documentation.
rafae11
Experienced Solver
Experienced Solver
Posts: 85
Joined: Sat Jun 02, 2012 8:41 am

Re: populate wxchoice

Post by rafae11 »

thanks alot
Post Reply