【问题标题】:Code for buttons or text not working with PySimpleGui按钮或文本的代码不适用于 PySimpleGui
【发布时间】:2023-01-26 04:01:17
【问题描述】:
import PySimpleGUI as sg

layout = [[sg.Text("Placeholder")], [sg.Button("OK")]]
window = sg.Window('Window Title', layout, location=(0,0), size=(1000,700), keep_on_top=True)

while True:
    event, values = window.read()

    if event == "OK" or event == sg.WIN_CLOSED:
        break

我是 GUI 编程的新手。我尝试使用此代码创建一个带有按钮的简单窗口,但是当我这样做时,我只得到一个没有按钮或文本的空白屏幕。

【问题讨论】:

  • 窗口中显示的文本和按钮在我的 WIN10 上运行良好。

标签: python pysimplegui


【解决方案1】:

这就是它在我看来的样子,看起来不错:

enter image description here

【讨论】:

    猜你喜欢
    • 2021-03-18
    • 1970-01-01
    • 2017-04-09
    • 1970-01-01
    • 2021-11-30
    • 2013-12-06
    • 2020-01-20
    • 1970-01-01
    • 2017-11-09
    相关资源
    最近更新 更多