Merge pull request #1375 from PySimpleGUI/Dev-latest
Added back automatic key creation. Changed FindElement to use new Ke…
This commit is contained in:
commit
d704ba7f2c
|
@ -3909,7 +3909,11 @@ class Window:
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def FindElement(self, key, silent_on_error=False):
|
def FindElement(self, key, silent_on_error=False):
|
||||||
element = _FindElementFromKeyInSubForm(self, key)
|
try:
|
||||||
|
element = self.AllKeysDict[key]
|
||||||
|
except KeyError:
|
||||||
|
element = None
|
||||||
|
# element = _FindElementFromKeyInSubForm(self, key)
|
||||||
if element is None:
|
if element is None:
|
||||||
if not silent_on_error:
|
if not silent_on_error:
|
||||||
print('*** WARNING = FindElement did not find the key. Please check your key\'s spelling ***')
|
print('*** WARNING = FindElement did not find the key. Please check your key\'s spelling ***')
|
||||||
|
@ -4420,7 +4424,7 @@ def ColorChooserButton(button_text, target=(None, None), image_filename=None, im
|
||||||
def AddToReturnDictionary(form, element, value):
|
def AddToReturnDictionary(form, element, value):
|
||||||
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
|
||||||
form.DictionaryKeyCounter += 1
|
form.DictionaryKeyCounter += 1
|
||||||
else:
|
else:
|
||||||
form.ReturnValuesDictionary[element.Key] = value
|
form.ReturnValuesDictionary[element.Key] = value
|
||||||
|
|
Loading…
Reference in New Issue