当我按下按钮时,我想改变组合体的默认值,可以这样做吗?
from PySimpleGUI import *
layout=[[Combo(["Example1","Example2","Example3"],default_value='example2',key='board2')],[Button("Change")]]
wnd=Window("Test",layout)
event,values=wnd.read()
if event=="Change":
wnd.find_element["board2"].update(default_value="example3")
else:
wnd.close()发布于 2021-10-09 03:24:08
wnd.find_element("board2").update(value="Example3")如果值在值"Example1“、"Example2”、"Example3“中,则DefaultValue也将更改为value。但是价值不是价值,DefaultValue不会改变。
https://stackoverflow.com/questions/69503365
复制相似问题