如何解决PySimpleGUI文本框输出,用于选择单选按钮后的信息
所以我现在想做的是,如果我单击一个单选按钮,则有关该方法的一些信息应自动显示在GUI中,但我似乎无法正确处理。 我想也许我可以通过使用if语句来完成它,但是什么也没发生。
import PySimpleGUI as sg
# List for Radiobuttons
radio_choices = ["Method 1","Method 2","Method 3","Method 4"]
layout = [[sg.Text("Choose Method")],*[[sg.Radio(text,1),] for text in radio_choices],[sg.Button("Start"),sg.Button("Stop"),sg.Button("Exit")]
]
window = sg.Window("Choose Method",layout,size=(350,350))
while True:
event,values = window.Read()
if event == "Exit" or event == sg.WIN_CLOSED:
break
if event == radio_choices[0]:
sg.Text("Method 1 description")
window.close()
解决方法
尝试一下:
const
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。