How to place a combobox in wxgrid (python)?
I can't find any good information on how to place a combobox inside a cell in a wxgrid. I tried Google, but m开发者_开发问答aybe I'm blind. Anyone have a simple sample to share?
Take a look at GridChoiceCellEditor. You can use it as follows:
choice_editor = wx.grid.GridCellChoiceEditor(choices_list, True)
grid.SetCellEditor(row, col, choice_editor)
The wxPython demo has an example that shows how this is done in the GridStdEdRend.py file itself or from within the demo itself, see the "Editors and Renderers Demo" part of the grid demo. What you're looking for is the GridCellChoiceEditor. See also: http://wiki.wxpython.org/GridCellChoiceEditor
精彩评论