Help with wxPython

M

mitsura

Hi,

I have encountered an annoying problem with wx.Choice from wx.Python.
Basically, what I want to do is create a drop down box with a set of
choices (so far so good). The problem is that when the drop down box is
created, the first entry in the list of the drop down box is empty and
you need to drop down in the list to make your choice.
I was looking for an option that allows to set a default/preset choice
in the list.
This is important because I have written an apps where you can set the
properties of objects (cars) via drop down list and choose between a
set of pre-defined choices. However, if the set the properties of the
car (color, model, ...) via the Edit Properties windows but later you
which to change a properties it would be nice to see the choices you
made in de dropdown list and not a blank a first choice.

It seems trivial do.

Any help very much appreciated.

Kris
 
R

Roel Schroeven

I have encountered an annoying problem with wx.Choice from wx.Python.
Basically, what I want to do is create a drop down box with a set of
choices (so far so good). The problem is that when the drop down box is
created, the first entry in the list of the drop down box is empty and
you need to drop down in the list to make your choice.
I was looking for an option that allows to set a default/preset choice
in the list.

The SetSelection method does that. I guess the reason you didn't find it
is because it is not included in the documentation for wxChoice itself;
it is described in the section for wxControlWithItems, which is
wxChoice's base class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,311
Members
47,986
Latest member
ColbyG935

Latest Threads

Top