I built a wx.grid object as part of a larger panel with other fields and buttons outside the grid. When it’s displayed on screen, the left edge seems to be truncated,and the gray color background for the column labels is offset several pixels to the right. I’ve looked at it in Ubuntu, KDE, and LXDE. In KDE Itried a number of window themes. It was the same glitch in all of them. Is this something I can correct?
It’s a simple enough object:
**self.colLabels = [“Depth”, “Type”, “Quant”, “Alpha”, “Beta”, “Conf”, **
"Infill", “Thick”, “Plan”, “Rough”, “Feature Comment”]
self.featuregrid = wx.grid.Grid(self)
self.featuregrid.SetDefaultColSize(50, True)
self.featuregrid.SetDefaultRowSize(20, True)
self.featuregrid.CreateGrid(8,11)
self.featuregrid.SetRowLabelSize(0) # Don’t display row labels
self.featuregrid.SetColLabelSize(20)
self.featuregrid.SetColSize(10,200)
self.featuregrid.SetDefaultCellFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL))
for col in range(11):
self.featuregrid.SetColLabelValue(col, self.colLabels[col])
self.featuregrid.SetLabelFont(wx.Font(8, wx.SWISS, wx.ITALIC, wx.NORMAL))
I then add it into a couple of sizers:
self.outersizer = wx.BoxSizer(wx.VERTICAL)
self.featuregridsizer = wx.BoxSizer(wx.HORIZONTAL)
…
self.featuregridsizer.Add(self.featuregrid, 0, wx.ALL, 5)
…
self.outersizer.Add(self.featuregridsizer, 0, wx.ALL, 20)
Here’s the result: