I would like to have choices in the drop down listed by category. Here is an
example:
Group A:
a
b
c
Group B:
d
e
f
I want to give have choices a,b,c,d,e,f but separated by group. Is it
possible to show Group A, Group B like in the example but have them
inactive (disabled)?
Thanks for your script but I intend to use wxChoice (drop down list). Do you
know if it is possible to disable certain choices in the drop down list? So
when the user tries to select Group A the drop down list remains open but
nothing happens (as opposed to the default behavior of choice being set and
drop down list closing)
Given that you seem to have “categories” in your drop down list (Group A, Group B), under which there are segregated items, it seems you probably want a tree control of some sort to drop down, with Group A being one node and Group B being another node.
There are several choices to do this. In the wxPython demo, you could look at ComboTreeBox. Problem is, I’m not sure there is a “disable an item” method in the underlying TreeCtrl (which I’m surprised to find out just now), but you could simulate it yourself by greying it out and doing nothing in response to clicking on that item. For that, see here:
Or you could put another kind of TreeCtrl in a ComboControl (you can put mostly anything into a comboPopup and it will pop that thing up), such as agw.CustomTreeCtrl. That one does have an EnableItem() method which you can set to False to disable the item.