add a wxchoice - name, code 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
Experienced Solver
Experienced Solver
Posts: 81
Joined: Sun Dec 08, 2013 3:50 am

add a wxchoice - name, code

Post by guzzi_jones » Thu Jan 09, 2014 3:10 am

I have a database table like so:
code, name
a, a_description
b, b_description.

I want to fill a wxchoice with the values from this table. a_descdription will be shown in the wxchoice. when the user chooses a value i want to be able to grabe the code and use it to insert into another table.
this seems like a common request.
Could someone point me to an example?

Part Of The Furniture
Part Of The Furniture
Posts: 2676
Joined: Sun Jan 03, 2010 5:45 pm

Re: add a wxchoice - name, code

Post by PB » Thu Jan 09, 2014 6:37 am

You could store the code in item's client data (using wxStringClientData). This is demonstrated in wxWidgets' controls example, see its wxChoice code part.

Post Reply