Hi folks,
I create a grid using
self.table_grid.CreateGrid(0, 0)
self.table_grid.SetSelectionMode(wx.grid.Grid.wxGridSelectRows)
self.table_grid.EnableEditing(False)
self.table_grid.SetCellHighlightPenWidth(0)
self.table_grid.SetColLabelAlignment(wx.ALIGN_LEFT, wx.ALIGN_CENTRE)
This creates an empty grid. I then create a wx.grid.GridTableBase with definitions I need to create my colums and row.
There may be some data to populate the grid or there may be no data. It depends if data was supplied to the program at startup.
This problem runs on linux, mac and windows.
On mac and windows it works perfectly but on linux I notice two problems:
- column zero label is “selected” - there is a box drawn around the column label for column zero. None of the other labels, row or column, have a box draw around them. I see no way to get rid of this box or to have all the label and rows get boxes too. But having only on label drawn with a box seems incorrect.
- when I click on any column label I get:
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on ‘_pixman_log_error’ to debug
Any help appreciated in resolving these two issues!!
-Jim
So I was able to get around the first problem by using:
self.table_grid.UseNativeColHeader(True)
This also has the advantage of enabling the context menu for selecting visible columns. Since my table has just four columns, this works for me.
But I am still getting problem 2.
···
On Sunday, June 16, 2019 at 9:57:37 AM UTC-4, Demetrios Tsillas wrote:
Hi folks,
I create a grid using
self.table_grid.CreateGrid(0, 0)
self.table_grid.SetSelectionMode(wx.grid.Grid.wxGridSelectRows)
self.table_grid.EnableEditing(False)
self.table_grid.SetCellHighlightPenWidth(0)
self.table_grid.SetColLabelAlignment(wx.ALIGN_LEFT, wx.ALIGN_CENTRE)
This creates an empty grid. I then create a wx.grid.GridTableBase with definitions I need to create my colums and row.
There may be some data to populate the grid or there may be no data. It depends if data was supplied to the program at startup.
This problem runs on linux, mac and windows.
On mac and windows it works perfectly but on linux I notice two problems:
- column zero label is “selected” - there is a box drawn around the column label for column zero. None of the other labels, row or column, have a box draw around them. I see no way to get rid of this box or to have all the label and rows get boxes too. But having only on label drawn with a box seems incorrect.
- when I click on any column label I get:
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on ‘_pixman_log_error’ to debug
Any help appreciated in resolving these two issues!!
-Jim
I should point out I am on 4.0.4. I’m updating to 4.0.6 as I see this is the latest.
···
On Sunday, June 16, 2019 at 9:57:37 AM UTC-4, Demetrios Tsillas wrote:
Hi folks,
I create a grid using
self.table_grid.CreateGrid(0, 0)
self.table_grid.SetSelectionMode(wx.grid.Grid.wxGridSelectRows)
self.table_grid.EnableEditing(False)
self.table_grid.SetCellHighlightPenWidth(0)
self.table_grid.SetColLabelAlignment(wx.ALIGN_LEFT, wx.ALIGN_CENTRE)
This creates an empty grid. I then create a wx.grid.GridTableBase with definitions I need to create my colums and row.
There may be some data to populate the grid or there may be no data. It depends if data was supplied to the program at startup.
This problem runs on linux, mac and windows.
On mac and windows it works perfectly but on linux I notice two problems:
- column zero label is “selected” - there is a box drawn around the column label for column zero. None of the other labels, row or column, have a box draw around them. I see no way to get rid of this box or to have all the label and rows get boxes too. But having only on label drawn with a box seems incorrect.
- when I click on any column label I get:
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on ‘_pixman_log_error’ to debug
Any help appreciated in resolving these two issues!!
-Jim
Ok so I figured out problem 2: My left click handler event.GetRow() for the column header returns -1. When I check for that and I return from the event handler, I never see the BUG warning.
···
On Sunday, June 16, 2019 at 9:57:37 AM UTC-4, Demetrios Tsillas wrote:
Hi folks,
I create a grid using
self.table_grid.CreateGrid(0, 0)
self.table_grid.SetSelectionMode(wx.grid.Grid.wxGridSelectRows)
self.table_grid.EnableEditing(False)
self.table_grid.SetCellHighlightPenWidth(0)
self.table_grid.SetColLabelAlignment(wx.ALIGN_LEFT, wx.ALIGN_CENTRE)
This creates an empty grid. I then create a wx.grid.GridTableBase with definitions I need to create my colums and row.
There may be some data to populate the grid or there may be no data. It depends if data was supplied to the program at startup.
This problem runs on linux, mac and windows.
On mac and windows it works perfectly but on linux I notice two problems:
- column zero label is “selected” - there is a box drawn around the column label for column zero. None of the other labels, row or column, have a box draw around them. I see no way to get rid of this box or to have all the label and rows get boxes too. But having only on label drawn with a box seems incorrect.
- when I click on any column label I get:
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on ‘_pixman_log_error’ to debug
Any help appreciated in resolving these two issues!!
-Jim