the combo is fed by records(tuple) extracted by a database.
I’m on debian.
suggestions?
regards
beppe
You just need to add a blank string as the first choice in your list of choices. The -1 is a special number that can mean a lot of different things in wxPython, so that won’t work.
the combo is fed by records(tuple) extracted by a database.
I’m on debian.
suggestions?
regards
beppe
You just need to add a blank string as the first choice in your list of choices. The -1 is a special number that can mean a lot of different things in wxPython, so that won’t work.
Since the SetSelection(-1) works well and I need to read the current selection I have resolved adding
self.cbDepartments.SetValue(‘’)
to force the combo to show a blank string.
I add a new simple app to clarify my purpose.
thanks mike.
A user experience suggestion:
Instead of having a blank string to signify to the user “no selection”, what I do is make a string that gives the user some information about what that comboCtrl is for, such as “Choose a selection…” and then I use that string to .SetValue() on the comboCtrl, and revert to that whenever things get reset. Sometimes the string can be even more specific than that, such as “Choose a provider…”, “Choose or enter a customer name…”, “Choose or enter a starting bid…”, etc.
This way, the control is its own label and there is (sometimes) no need to also have a staticText next to or above it to indicate its purpose.