From 559a37c16e9a1e184ec6c35fe45035e9d04b6dca Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Tue, 26 May 2020 18:14:26 -0400 Subject: [PATCH] If RadioButton updated to False, all buttons in the group are set to False --- PySimpleGUIWx/PySimpleGUIWx.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PySimpleGUIWx/PySimpleGUIWx.py b/PySimpleGUIWx/PySimpleGUIWx.py index d25101be..5f248c1d 100644 --- a/PySimpleGUIWx/PySimpleGUIWx.py +++ b/PySimpleGUIWx/PySimpleGUIWx.py @@ -803,9 +803,10 @@ class Radio(Element): def Update(self, value=None, disabled=None, background_color=None, text_color=None, font=None, visible=None): - if value: + if value is True: self.WxRadioButton.SetValue(True) elif value is False: + self.WxRadioButton.SetValue(True) self.WxRadioButton.SetValue(False) super().Update(self.WxRadioButton, background_color=background_color, text_color=text_color, font=font, visible=visible) @@ -4908,6 +4909,8 @@ def PackFormIntoFrame(container_elem, containing_frame, toplevel_form): hsizer.Add(sizer, 0) if element.InitialState: widget.SetValue(True) + else: + widget.SetValue(False) # ------------------------- INPUT SPINNER element ------------------------- # elif element_type == ELEM_TYPE_INPUT_SPIN: