On 11/13/09 10:29 AM, Philip Ellis wrote:
>
> Hi chaps
> Has anyone made listing 5.10 work in Robin Dunn "the software
> craftsman"'s book wxPython in Action?
>
> This example seems to be a more useful implementation than the
> previous examples, and so I had a go at making it work. The key seems
> to be creating a list of entries for the Chicago Cubs. So I stuck the
> little 2-dimensional table (position, firstname, lastname) as the
> return of a function called GetCubs and wrote this (based on listing
> 5.7):
>
> class SimpleGrid(wx.grid.Grid):
> def __init__(self, parent):
> wx.grid.Grid.__init__(self, parent, -1)
> team=GetCubs()
> entries=[LineupEntry(man[0],man[1],man[2]) for man in team]
> self.SetTable(LineupTable, entries)
You probably want to do this instead:
self.SetTable( LineupTable(entries) )
--
Robin Dunn
Software Craftsman
http://wxPython.org