473,241 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 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 2753
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override...
5
by: Mark Broadbent | last post by:
Oh yes its that chestnut again! Ive gone over the following (http://www.yoda.arachsys.com/csharp/faq/ -thanks Jon!) again regarding this subject and performed a few of my own tests. I have two...
2
by: Flip | last post by:
In java, the default for methods is override. In c# that is not the case. This talks about two classes, the base class and the overriding class. What happens when you have a third class in the...
5
by: Stoyan | last post by:
Hi All, I don't understand very well this part of MSDN: "Derived classes that override GetHashCode must also override Equals to guarantee that two objects considered equal have the same hash code;...
15
by: John Salerno | last post by:
Hi all. I have a question about virtual and override methods. Please forgive the elementary nature! First off, let me quote Programming in the Key of C#: "Any virtual method overridden with...
2
by: Adriano Coser | last post by:
Hello. After I converted my .net code to the new VC2005 syntax I started to get C4490 on my ExpandableObjectConverter subclass overrides. The GetProperties method is no longer called by the...
8
by: bdeviled | last post by:
I am deploying to a web environment that uses load balancing and to insure that sessions persist across servers, the environment uses SQL to manage sessions. The machine.config file determines how...
5
by: Marcel Hug | last post by:
Hi NG ! I'm new in C# and I'm reading a book about the fundamentals and concepts. In the chapter Methods it's written to use virtual, if i would like to override the method in a subclass. This...
1
by: Mario Lacunza | last post by:
--------- Mensaje reenviado -------- De: Mario Lacunza <mario.lacunza@gmail.com> Para: Lista Python Ing <python-list@python.org> Asunto: Problems with PyGridTableBase Fecha: Sat, 09 Sep 2006...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.