[wxPython] Grid question -- refresh?

Hiya. Excuse the stupid question, but my eyes are crossing
when looking over the 'new' grid .py and .cpp code to figure
out all the options and how to work everything.. that's not
working, so i'm basically cutting and pasting examples
together to hope things work :slight_smile:

I have a wxGrid with a wxPyGridTableBase, mostly taken from
the GridCustTable.py demo.

Now.. how do I specify how wide i want the columns to be? :slight_smile:

Thanks.

--Stephen

路路路

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

Hi

In class wxGrid you can define for example:

class CustTableGrid(wxGrid):
聽聽聽聽def __init__(self, parent):
聽聽聽聽聽聽聽聽wxGrid.__init__(self, parent, -1 )

聽聽聽聽聽聽聽聽self.table = CustomDataTable(self) #class
CustomDataTable(wxPyGridTableBase):
聽聽聽聽聽聽聽聽self.SetTable(self.table, true)
聽聽聽聽聽聽聽聽.....
聽聽聽聽聽聽聽聽.....

聽聽聽聽聽聽聽聽self.ColCount=2
聽聽聽聽聽聽聽聽self.ColLen=[]
聽聽聽聽聽聽聽聽self.ColLen[0]=100
聽聽聽聽聽聽聽聽self.ColLen[1]=200

聽聽聽def SetColumnsSize(self):
聽聽聽聽聽聽聽聽for c in xrange( self.ColCount ):
聽聽聽聽聽聽聽聽聽聽聽self.SetColSize(c, self.ColLen(c) )

Mariusz

路路路

-----Original Message-----
From: wxpython-users-admin@lists.sourceforge.net
[mailto:wxpython-users-admin@lists.sourceforge.net]On Behalf Of Stephen
Sent: Thursday, December 14, 2000 8:16 AM
To: wxpython-users
Subject: [wxPython] Grid question -- refresh?

Hiya. Excuse the stupid question, but my eyes are crossing
when looking over the 'new' grid .py and .cpp code to figure
out all the options and how to work everything.. that's not
working, so i'm basically cutting and pasting examples
together to hope things work :slight_smile:

I have a wxGrid with a wxPyGridTableBase, mostly taken from
the GridCustTable.py demo.

Now.. how do I specify how wide i want the columns to be? :slight_smile:

Thanks.

--Stephen

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

Now.. how do I specify how wide i want the columns to be? :slight_smile:

    grid.SetColSize(col, width)

路路路

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users