700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > wxpython grid设置字体颜色_如何设置wxPython网格背景颜色?

wxpython grid设置字体颜色_如何设置wxPython网格背景颜色?

时间:2019-04-21 07:10:02

相关推荐

wxpython grid设置字体颜色_如何设置wxPython网格背景颜色?

我正在使用wxPython网格,但是我不能设置它的背景色(没有填充单元格的网格部分)。我试过了网格背景颜色,但运气不佳;显示的背景色始终是windows的默认系统颜色。在

在版本.wx()—>2.8.10.1(msw unicode)

在系统版本->2.5(r25:519089月19日,09:52:17)[MSCV.1310 32位(Intel)]

O/S版本->windowsxpsp3,但是我尝试了一个基于Ubuntu的Python livecd,结果是一样的。在import wx

import wx.grid

class TestFrame (wx.Frame):

def __init__ (self):

wx.Frame.__init__ (self, None, title="Grid Table", size=(640,480))

grid = wx.grid.Grid(self, size=(300,300))

grid.CreateGrid(2,2)

grid.SetCellValue(0,0,"1")

color = (100,100,255)

attr = self.cellAttr = wx.grid.GridCellAttr()

attr.SetBackgroundColour(color)

# for row, col in

for row in xrange(2):

for col in xrange(2):

grid.SetAttr(row, col, attr)

grid.SetBackgroundColour(color) # <<< This don't work!

app = wx.PySimpleApp()

frame = TestFrame()

frame.Show()

app.MainLoop()

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。