Since we encountered an issue running an Interactive Batch file with multiple windows being spawned <https://www.winflector.com/store/forum/topic-view/id/602>, we attempted to migrate the same to Python.
While the complied EXE works fine when accessed directly, or via Winflector on a desktop - the GUI fails to display when accessed via Winflector on a laptop. The issue appears to be specific to the using of PySimpleGUI, as a simple test of "Hello World" popup works perfectly fine.
An extract of the sample code to demonstrate is as follows:
import PySimpleGUI as sg
import sys
options = ['Option A','Option B','Option C','Option D']
layout = [
[sg.Text('Select One ->'), sg.Listbox(options,select_mode=sg.LISTBOX_SELECT_MODE_SINGLE,size=(20,len(options)))],
[sg.Button('Ok'), sg.Button('Cancel')]
]
window = sg.Window('Options', layout, icon=r'mstsc.ico')
while True:
event, values = window.read()
if event is None or event == 'Ok' or event == 'Cancel':
break
window.close()
if values[0] == ['Option A']:
sg.popup_auto_close( "You selected Option A", icon=r'mstsc.ico' )
elif values[0] == ['Option B']:
sg.popup_auto_close( "You selected Option B", icon=r'mstsc.ico' )
elif values[0] == ['Option C']:
sg.popup_auto_close( "You selected Option C", icon=r'mstsc.ico' )
elif values[0] == ['Option D']:
sg.popup_auto_close( "You selected Option D", icon=r'mstsc.ico' )
else:
sys.exit()
Any ideas are most appreciated.