[Boa Constr] Getting a grid of wxButton
Status: Beta
Brought to you by:
riaan
From: <sd...@de...> - 2004-07-08 11:59:27
|
Hi, i'm quite new to Boa and python too; after many unsuccesful attempts = i cannot get this to work: Remember the winmine game? I would like to get a grid of NxM buttons working just like in the winmin= e game:=20 each single button being served by one only function, having position (ro= w,col) of the button clicked as a parameter. I tried from within Boa=20 using a wxGridSizer and adding into __init__(self,parent) a piece of code= like this: def __init__(self, parent): self._init_ctrls(parent) for i in range(self.gridSizer1.GetRows() * self.gridSizer1.GetCol= s()): self.gridSizer1.Add(wxButton(parent, 1010, 'one'), 0, wxEXP= AND) But i had no success. After a few many unsuccesful tries i don't even know if it is possible fr= om within Boa-constructor (although it seems to be possible with wxPython libraries, looking example simple.py from wxPython-2.4-examples). Could somebody please tell me a right way or showing me an example of, sa= y, 5x6 Buttons Grid? Thank you in advance, Stefano ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ |