wxPython – IsItemEnabled() method in wx.RadioBox
Last Updated :
01 Mar, 2023
In this article we are going to learn about IsItemEnabled() method associated with wx.RadioBox class of wxPython. IsItemEnabled() method is simply used to return True if the item is enabled or False if it was disabled using Enable . Note, this function is currently only implemented in wxMSW, wxGTK, QT and wxUniversal and always returns True in the other ports.
Syntax: wx.RadioBox.IsItemEnabled(self, n) Parameters
Parameter |
Input Type |
Description |
n |
int |
The zero-based button position. |
Return Type: bool
Code Example:
Python3
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)
print ( self .rbox.IsItemEnabled( 0 ))
self .Centre()
self .SetSize(( 400 , 250 ))
self .Show( True )
ex = wx.App()
FrameUI( None , 'RadioButton and RadioBox' )
ex.MainLoop()
|
Console Output:
True
Output Window:
Share your thoughts in the comments
Please Login to comment...