I need a little advice on a layout I am working on.
I am displaying dynamic radio boxes in a scrolled panel.
That part works fine. What I don't know is how to I bind the radio boxes to my GUI?
Here are some snippets:
...
# no text needed
ynlist = [' ',' ',' ']
# from the demo app
self.radioGroup1 = []
...
for i in range(12):
label = wx.StaticText( self.panel1, -1, "This is a test\n Test it is!")
rb = wx.RadioBox( self.panel1, -1, "", wx.DefaultPosition, (-1, -1), ynlist, 1, wx.RA_SPECIFY_ROWS)
self.radioGroup1.append(rb)
rowSizer.Add(label, flag=wx.ALIGN_RIGHT
> wx.ALIGN_CENTER
> wx.LEFT, border=1)
rowSizer.Add(rb, flag=wx.ALIGN_RIGHT | wx.ALIGN_CENTER, border=1)
self.panel1.SetSizer( rowSizer )
self.panel1.SetAutoLayout(True)
self.panel1.SetupScrolling(scroll_x=False)
...
for radio in self.radioGroup1:
radio.SetSelection(2)
parent.Bind(wx.EVT_RADIOBUTTON, self.onEvtRadioBox, radio )
print radio
...
The layout works fine and so does 'radio.SetSelection1(2)' (print works too). The binding isn't working at all.
Thanks for any suggestions.
Scott
···
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 4/7/2005