I am writing Python code for a 10.1 inch touchscreen to display. I am using PiSimpleGUI for the interface. When I use popup windows, I am not able to click on the “ok” or “cancel” buttons on the popup with my finger, however if I use a mouse it works. In the normal windows, I can click on regular buttons to carry out my functions with my finger, but why wont it let me click the popup windows? I provide a snippet of code below to show the popup windows I am referring to.
elif event == '-FINISH-':
if self.selected_button:
# Construct the message using f-string
message = f' You Selected: n Hardware: {self.selected_button}n Quantity: {values["-QUANTITY-"]}'
# Display the popup
popup_result = sg.popup_yes_no(message, title="", font=('Helvetica', 14), keep_on_top=True)
if popup_result == 'Yes':
# Add selected hardware and quantity to the shopping list
hardware = self.selected_button
quantity = int(values['-QUANTITY-'])
self.add_to_shopping_list(hardware, quantity)
# Display the shopping list popup
shopping_action = self.handle_shopping_list()
if shopping_action == 'submit_order':
return State.DISPENSE_LOADING_SCREEN # Transition to dispense loading screen
# Reset selected button and quantity slider
self.window[self.selected_button].update(button_color=('black', '#598baf'))
self.selected_button = None
self.window['-QUANTITY-'].update(5) # Move the slider back to 5
else:
sg.popup_ok("Please Select Hardware Before Finishing", title="Alert", font=('Helvetica', 14),
keep_on_top=True)
I have tried everything I can think of.