Jump to content

Recommended Posts

  • 1 month later...

Please have a look at the attached solution. The trick is to convert the returned object into a string and then parse it into an array and (if needed) into a dictionary.

Please note that the values inside the dictionary are still strings, but converting to the desired types (boolean, integer, float) should be easy.

Example output from a dialog with 4 checkboxes:

RESULT (string) gom.dialog.DialogResult ('checkbox_0': True, 'checkbox_1': False, 'checkbox_2': True, 'checkbox_3': False)
'checkbox_0': True, 'checkbox_1': False, 'checkbox_2': True, 'checkbox_3': False
key: checkbox_0 val:  True
key: checkbox_1 val:  False
key: checkbox_2 val:  True
key: checkbox_3 val:  False
RESULT (dictionary) {'checkbox_0': 'True', 'checkbox_1': 'False', 'checkbox_2': 'True', 'checkbox_3': 'False'}
checkbox_0 True
checkbox_1 False
checkbox_2 True
checkbox_3 False

 

dialog_results.py

Link to comment
https://qualityforum.zeiss.com/topic/2936-dialog-results/#findComment-7993
Share on other sites

×
×
  • Create New...