wxWidgets/wxPython/demo/wxRadioBox.py
Robin Dunn 493f1553fd Cleanup up the demo a bit
Added wxWave

Added another patch for SWIG that optimizes the generated code some
and eliminates some unused type mappings in the type registry.
(Reduces it by about half!)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-05-18 21:59:59 +00:00

56 lines
1.5 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))
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 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.
"""