How do I fix this?
layout = [
[sg.Text("Welcome to blackjack!")],
[sg.Text(F"Your cards: {player_cards}", key='pc')],
[sg.Text(F"The value of your cards: {player_value}", key='pv')],
[sg.Text(F"Dealer cards: [{computer_cards[0]}, ---]", key="cc")],
[sg.Text("", key="cv")],
[sg.Text("", key="results")],
[sg.Button("Deal", key='-BUT1-'), sg.Button("Stand", key='-BUT2-')],
]
window = sg.Window("the box", layout)
while True:
event, values = window.read()
check_win()
if event == sg.WIN_CLOSED:
break
elif event == "Deal":
deal()
window['pc'].update(F"Your cards: {player_cards}")
window['pv'].update(F"The value of your cards: {player_value}")
check_win()
elif event == "Stand":
end_game()
window['-BUT1-'].update(visible=False)
window['-BUT2-'].update(visible=False)
window.close()
Adding the .update() code near the end to -BUT1- and -BUT2- makes the buttons stop working entirely. I don't understand why this is happening. How do I fix this? Also note any functions being called were removed because stackoverflow wouldn't let me post otherwise.