wxPython - Disable Radio button
Syntax: wx.RadioButton.Disable(self) Parameters: No parameters are required by Disable() function Return Type: bool Returns: Returns True if the window has been disabled, False if it had been already disabled before the call to this function.Code Example:
import wx
APP_EXIT = 1
class Example(wx.Frame):
def __init__(self, *args, **kwargs):
super(Example, self).__init__(*args, **kwargs)
self.InitUI()
def InitUI(self):
# create parent panel for radio buttons
self.pnl = wx.Panel(self)
# create radio button at position (30, 10)
self.rb1 = wx.RadioButton(self.pnl, label ='Btn1',
pos =(30, 10), size =(100, 20))
# disable the radio button
self.rb1.Disable()
def main():
app = wx.App()
ex = Example(None)
ex.Show()
app.MainLoop()
if __name__ == '__main__':
main()
