How to achieve ComboBox in GridCells?

Hi,

#This program could achieve choice in Gridcell

import wx
import wx.grid

class Frame(wx.Frame):
def init(self, parent=None, id=-1, title=‘wx.grid.Grid’,
pos=wx.DefaultPosition,size=wx.DefaultSize,
style=wx.DEFAULT_FRAME_STYLE):
wx.Frame.init(self, parent, id, title, pos, size, style)
self.CreateStatusBar()
self.Grid = wx.grid.Grid(self, -1)
self.Grid.CreateGrid(2, 2)

Languages = [‘C’, ‘C++’, ‘Python’, ‘Java’, ‘Perl’, ‘Ruby’]
ChoiceEditor = wx.grid.GridCellChoiceEditor(Languages)
self.Grid.SetCellEditor(0, 0, ChoiceEditor)

def TestFrame():
app = wx.PySimpleApp()
frame = Frame(size=(300, 150))
frame.Centre()
frame.Show
()
app.MainLoop()

if name == ‘main’:
TestFrame()

···

####################################################

How to achieve ComboBox in GridCells?
Thanks.

Write your own grid cell editor. See the sample file GridCustEditor.py
in the demo.

···

On 8/15/07, 王超凡 <wangchaofan@gmail.com> wrote:

How to achieve ComboBox in GridCells?
Thanks.

--
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn