In this article we will learn how can we show a hidden radio button. In order to unhide/show a radio button we can use Show() function. Show() function can be used to do both show as well as hide the radio button. Show() function takes show boolean parameter which, If True displays the window. Otherwise, hides it.
Syntax: wx.RadioButton.Show(self, show=True)
Parameters:
Parameter Input Type Description show bool If True displays the window. Otherwise, hides it. Return Type: bool
Returns: True if the window has been shown or hidden or False if nothing was done because it already was in the requested state.
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): 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)) # create button self.btn = wx.Button(self.pnl, label ='Btn1', pos =(30, 50), size =(100, 20)) # hide radio button self.rb1.Hide() # bind event function self.btn.Bind(wx.EVT_BUTTON, self.Onclick) def Onclick(self, e): # show hidden radio button self.rb1.Show() def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() |
Output Window:

before clickin button

after clicking button
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
Recommended Posts:
- wxPython - Show hidden Radio Box
- wxPython - Show hidden toolbar in the frame
- wxPython - Create Radio Button using Create() function
- wxPython - Change Font colour of Radio Button
- wxPython - Change font of Radio Button
- wxPython - Change Background Colour of Radio Button
- wxPython - Set Tooltip for radio button
- wxPython - Disable Radio button
- wxPython - Change Size of Radio Button
- wxPython - Hide Radio Button
- wxPython - Get size of Radio Button Window
- PyQt5 - Show pop up items of ComboBox when push button is pressed
- wxPython - Create Radio Box with two step creation
- wxPython | Get default attributes of Radio Box
- wxPython - Hide Radio Box from the frame
- wxPython - Disable Radio Box present in frame
- wxPython - Create Radio Box with Items in different orientation
- wxPython - Change font for text present in Radio Box
- wxPython - Replace() function in wxPython
- wxPython | EnableTool() function in wxPython
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

