All:
Using the following code under OS X, if a button is selected, an event is generated for the deselected button and the selected button. Under GTK and Win98, only the selected button generates an event.
Craig
import wx
class panel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
b1 = wx.RadioButton(self, 20, 'One', (10, 10), (50, 20), style=wx.RB_GROUP)
b2 = wx.RadioButton(self, 21, 'Two', (10, 40), (50, 20))
self.Bind(wx.EVT_RADIOBUTTON, self.OnRunEvent, b1)
self.Bind(wx.EVT_RADIOBUTTON, self.OnRunEvent, b2)
def OnRunEvent(self, event):
print event.GetInt()
app = wx.PySimpleApp()
f = wx.Frame(None, -1,'Radio Test', (200, 200), (350, 200))
p = panel(f)
f.Show()
app.MainLoop()