How to achieve ComboBox in GridCells?
王超凡
wangchaofan at gmail.com
Tue Aug 14 19:43:52 PDT 2007
Hi,
#This program could achieve choice in Gridcell
import wx
import wx.grid
class Frame(wx.Frame):
def __init__(self, parent=3DNone, id=3D-1, title=3D'wx.grid.Grid',
pos=3Dwx.DefaultPosition,size=3Dwx.DefaultSize,
style=3Dwx.DEFAULT_FRAME_STYLE):
wx.Frame.__init__(self, parent, id, title, pos, size, style)
self.CreateStatusBar()
self.Grid =3D wx.grid.Grid(self, -1)
self.Grid.CreateGrid(2, 2)
Languages =3D ['C', 'C++', 'Python', 'Java', 'Perl', 'Ruby']
ChoiceEditor =3D wx.grid.GridCellChoiceEditor(Languages)
self.Grid.SetCellEditor(0, 0, ChoiceEditor)
def TestFrame():
app =3D wx.PySimpleApp()
frame =3D Frame(size=3D(300, 150))
frame.Centre()
frame.Show ()
app.MainLoop()
if __name__ =3D=3D '__main__':
TestFrame()
####################################################
How to achieve ComboBox in GridCells?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200708=
15/cd7dc27a/attachment.htm
More information about the wxpython-users
mailing list