[wxPython-users] Setting wx.Grid Widget Size
Christopher Barker
Chris.Barker at noaa.gov
Thu Aug 30 15:15:34 PDT 2007
Rich,
I don't have time to dig into your code much, but I do have some
thoughts. Think about OO relationships. It's important to distinguish
between the "is a" relationship and the "has a" relationship.
Is modData a Panel, or is it a wx.grid.Grid?
- I think it's a wx.grid.Grid, so it should derive from wx.grid.Grid.
Deriving from a class is usually making something that is a special
version of that class.
What is your page?
- it is a Panel, so your page derives from wx.Panel.
What is on that page?
- a modData object and a button.
So your page "has a" modDobject, rather than "being" a modData object.
You need a Page class that "has a" modData object and "has a" button
object as children, and lays them out with a sizer.
The modData object derives from wx.grid.Grid. It "is a" Grid. It has all
the methods like: def OnCellChange(self, evt): that are used to work
with it.
Take a look at what I posted before again -- I think it is the structure
you want.
-CHB
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
More information about the wxpython-users
mailing list