import
wx
class
FrameUI(wx.Frame):
def
__init__(
self
, parent, title):
super
(FrameUI,
self
).__init__(parent, title
=
title, size
=
(
300
,
200
))
self
.InitUI()
def
InitUI(
self
):
pnl
=
wx.Panel(
self
)
lblList
=
[
'Radio One'
,
'Radio Two'
]
self
.rbox
=
wx.RadioBox(pnl, label
=
'RadioBox'
, pos
=
(
80
,
10
), choices
=
lblList,
majorDimension
=
1
, style
=
wx.RA_SPECIFY_ROWS)
self
.btn
=
wx.Button(pnl,
1
,
"Hide RadioBox"
, pos
=
(
125
,
100
));
self
.btn1
=
wx.Button(pnl,
2
,
"Show RadioBox"
, pos
=
(
125
,
150
));
self
.btn.Bind(wx.EVT_BUTTON,
self
.onclick)
self
.btn1.Bind(wx.EVT_BUTTON,
self
.onclick1)
self
.Centre()
self
.SetSize((
400
,
250
))
self
.Show(
True
)
def
onclick(
self
, e):
self
.rbox.Show(
False
)
def
onclick1(
self
, e):
self
.rbox.Show()
ex
=
wx.App()
FrameUI(
None
,
'RadioButton and RadioBox'
)
ex.MainLoop()