Fixed missing Radio Buttons from auto key dictionary. Image added to test harness
This commit is contained in:
parent
a949dabf92
commit
83b8223f01
|
@ -3950,6 +3950,7 @@ class Window:
|
||||||
def BuildKeyDict(self):
|
def BuildKeyDict(self):
|
||||||
dict = {}
|
dict = {}
|
||||||
self.AllKeysDict = self._BuildKeyDictForWindow(self,self, dict)
|
self.AllKeysDict = self._BuildKeyDictForWindow(self,self, dict)
|
||||||
|
# print(f'keys built = {self.AllKeysDict}')
|
||||||
|
|
||||||
def _BuildKeyDictForWindow(self, top_window, window, key_dict):
|
def _BuildKeyDictForWindow(self, top_window, window, key_dict):
|
||||||
for row_num, row in enumerate(window.Rows):
|
for row_num, row in enumerate(window.Rows):
|
||||||
|
@ -3971,7 +3972,7 @@ class Window:
|
||||||
ELEM_TYPE_INPUT_SLIDER, ELEM_TYPE_GRAPH, ELEM_TYPE_IMAGE,
|
ELEM_TYPE_INPUT_SLIDER, ELEM_TYPE_GRAPH, ELEM_TYPE_IMAGE,
|
||||||
ELEM_TYPE_INPUT_CHECKBOX, ELEM_TYPE_INPUT_LISTBOX, ELEM_TYPE_INPUT_COMBO,
|
ELEM_TYPE_INPUT_CHECKBOX, ELEM_TYPE_INPUT_LISTBOX, ELEM_TYPE_INPUT_COMBO,
|
||||||
ELEM_TYPE_INPUT_MULTILINE, ELEM_TYPE_INPUT_OPTION_MENU, ELEM_TYPE_INPUT_SPIN,
|
ELEM_TYPE_INPUT_MULTILINE, ELEM_TYPE_INPUT_OPTION_MENU, ELEM_TYPE_INPUT_SPIN,
|
||||||
ELEM_TYPE_INPUT_TEXT):
|
ELEM_TYPE_INPUT_RADIO, ELEM_TYPE_INPUT_TEXT):
|
||||||
element.Key = top_window.DictionaryKeyCounter
|
element.Key = top_window.DictionaryKeyCounter
|
||||||
top_window.DictionaryKeyCounter += 1
|
top_window.DictionaryKeyCounter += 1
|
||||||
if element.Key is not None:
|
if element.Key is not None:
|
||||||
|
@ -4460,6 +4461,8 @@ def ColorChooserButton(button_text, target=(None, None), image_filename=None, im
|
||||||
##################################### ----- RESULTS ------ ##################################################
|
##################################### ----- RESULTS ------ ##################################################
|
||||||
|
|
||||||
def AddToReturnDictionary(form, element, value):
|
def AddToReturnDictionary(form, element, value):
|
||||||
|
form.ReturnValuesDictionary[element.Key] = value
|
||||||
|
return
|
||||||
if element.Key is None:
|
if element.Key is None:
|
||||||
form.ReturnValuesDictionary[form.DictionaryKeyCounter] = value
|
form.ReturnValuesDictionary[form.DictionaryKeyCounter] = value
|
||||||
element.Key = form.DictionaryKeyCounter
|
element.Key = form.DictionaryKeyCounter
|
||||||
|
@ -5698,6 +5701,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
element._TKCanvas2.bind('<Button-3>', element.RightClickMenuCallback)
|
element._TKCanvas2.bind('<Button-3>', element.RightClickMenuCallback)
|
||||||
# ------------------------- MENUBAR element ------------------------- #
|
# ------------------------- MENUBAR element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_MENUBAR:
|
elif element_type == ELEM_TYPE_MENUBAR:
|
||||||
|
element = element # type: MenuBar
|
||||||
menu_def = element.MenuDefinition
|
menu_def = element.MenuDefinition
|
||||||
element.TKMenu = element.Widget = tk.Menu(toplevel_form.TKroot, tearoff=element.Tearoff) # create the menubar
|
element.TKMenu = element.Widget = tk.Menu(toplevel_form.TKroot, tearoff=element.Tearoff) # create the menubar
|
||||||
menubar = element.TKMenu
|
menubar = element.TKMenu
|
||||||
|
@ -7795,6 +7799,7 @@ def main():
|
||||||
|
|
||||||
layout1 = [
|
layout1 = [
|
||||||
[Menu(menu_def)],
|
[Menu(menu_def)],
|
||||||
|
[Image(data=DEFAULT_BASE64_ICON)],
|
||||||
[Text('You are running the PySimpleGUI.py file itself', font='ANY 15', tooltip='My tooltip', key='_TEXT1_')],
|
[Text('You are running the PySimpleGUI.py file itself', font='ANY 15', tooltip='My tooltip', key='_TEXT1_')],
|
||||||
[Text('You should be importing it rather than running it', font='ANY 15')],
|
[Text('You should be importing it rather than running it', font='ANY 15')],
|
||||||
[Frame('Input Text Group', frame1, title_color='red'),
|
[Frame('Input Text Group', frame1, title_color='red'),
|
||||||
|
|
Loading…
Reference in New Issue