When I call wx.ComboBox.SetValue() with a string, it selects one from its
predefined list if my string PARTIALLY matches with one of the predefined
strings:
I could be wrong, but I think that is the intention. My first thought is to make the ComboBox READ-ONLY with the style CB_READONLY then see if you don’t get that behaviour.
···
On Monday, February 2, 2015 at 8:59:25 AM UTC-8, sungjune.lee wrote:
Then the combobox displays ‘10’ rather than ‘1’. However if I set ‘1.’ for
But my intention was to allow users to choose any numbers. Actual problem
goes like this:
- User enters number '1' in the combobox
- Program reads the user input and save the number '1' in a file.
- Later when user run the program again, he will see '10' instead of '1'
because python will try
MyComboBox.SetValue('1')
- But if he choose '1.' instead then he will see '1.'
Are you sure the "10" being displayed is a result of your SetValue? It may
be just
left over from the button setup when the run starts because you say the "10"
appears
the next time the user runs the program. And "10" is index 0 of your
choices.
Or are you looking at the field before the screen has a chance to update,
perhaps?