471,624 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,624 software developers and data experts.

How to override PyGridTableBase.SetColLabelValue()?

Dear all,

the doc is missing, and
i failed to find the solution on google search.
anyone know how to override
the function SetColLabel() inside the class PyGridTableBase or the
class GridTableBase?

my code,
#===========================================
class MegaTable(wx.grid.PyGridTableBase):
def __init__(...)
......
wx.grid.PyGridTableBase.__init__(self)

def SetColLabelValue(self, col, value):
value = self.coltags[col]
-->how to ???

class MegaGrid(wx.grid.Grid):
def __init__(...)
......
wx.grid.Grid.__init__(self, parent, id)
self._table = MegaTable(self, .....)
self.SetTable(self._table)
......
#===========================================
thanks!

Jul 9 '07 #1
1 2619
On Jul 9, 5:27 am, fck...@gmail.com wrote:
Dear all,

the doc is missing, and
i failed to find the solution on google search.
anyone know how to override
the function SetColLabel() inside the class PyGridTableBase or the
class GridTableBase?

my code,
#===========================================
class MegaTable(wx.grid.PyGridTableBase):
def __init__(...)
.....
wx.grid.PyGridTableBase.__init__(self)

def SetColLabelValue(self, col, value):
value = self.coltags[col]
-->how to ???

class MegaGrid(wx.grid.Grid):
def __init__(...)
.....
wx.grid.Grid.__init__(self, parent, id)
self._table = MegaTable(self, .....)
self.SetTable(self._table)
.....
#===========================================

thanks!
You are not supposed to override SetColLabel(), you are supposed to
override GetColLabelValue().

When you use PyGridTableBase, there could potentially be thousands of
columns, and wxPython does not want to keep track of thousands of
column labels.

Therefore, when wxPython needs to display a column label, it calls
GetColLabelValue(self,col). It is up to you to return the value to use
for that column.

HTH

Frank Millman

Jul 9 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Dave Y | last post: by
5 posts views Thread by Mark Broadbent | last post: by
2 posts views Thread by Flip | last post: by
5 posts views Thread by Stoyan | last post: by
15 posts views Thread by John Salerno | last post: by
8 posts views Thread by bdeviled | last post: by
5 posts views Thread by Marcel Hug | last post: by
1 post views Thread by Mario Lacunza | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.