wxWidgets/wxPython/demo/wxRadioBox.py
Robin Dunn 4268f79856 Changed (again) how the Python global interpreter lock is handled as
well as the Python thread state.  This time it works on SMP machines
without barfing and is also still compatible with Python debuggers.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-19 21:25:11 +00:00

61 lines
1.7 KiB
Python

from wxPython.wx import *
#---------------------------------------------------------------------------
class TestRadioButtons(wxPanel):
def __init__(self, parent, log):
self.log = log
wxPanel.__init__(self, parent, -1)
#self.SetBackgroundColour(wxBLUE)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
'six', 'seven', 'eight']
rb = wxRadioBox(self, 30, "wxRadioBox", wxPoint(35, 30), wxDefaultSize,
sampleList, 3, wxRA_SPECIFY_COLS)
EVT_RADIOBOX(self, 30, self.EvtRadioBox)
#rb.SetBackgroundColour(wxBLUE)
rb.SetToolTip(wxToolTip("This is a ToolTip!"))
wxRadioButton(self, 32, "wxRadioButton", (235, 35))
wxRadioButton(self, 33, "wxRadioButton", (235, 55))
EVT_RADIOBUTTON(self, 32, self.EvtRadioButton)
EVT_RADIOBUTTON(self, 33, self.EvtRadioButton)
rb = wxRadioBox(self, 35, "", wxPoint(35, 120), wxDefaultSize,
sampleList, 3, wxRA_SPECIFY_COLS | wxNO_BORDER)
EVT_RADIOBOX(self, 35, self.EvtRadioBox)
def EvtRadioBox(self, event):
self.log.WriteText('EvtRadioBox: %d\n' % event.GetInt())
def EvtRadioButton(self, event):
self.log.write('EvtRadioButton:%d\n' % event.GetInt())
#---------------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestRadioButtons(nb, log)
return win
#---------------------------------------------------------------------------
overview = """\
A radio box item is used to select one of number of mutually exclusive choices. It is displayed as a vertical column or horizontal row of labelled buttons.
"""