开发者

How to place a combobox in wxgrid (python)?

开发者 https://www.devze.com 2023-04-03 07:39 出处:网络
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 GridCh

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

0

精彩评论

暂无评论...
验证码 换一张
取 消