简体   繁体   中英

How to change layout size in pysimplegui?

I'm using pysimplegui, when I run this code it shows a very small screen...

I would like to know if there is a size attribute to make with ka screen always starts in full screen, that is, occupying my full screen by default

import PySimpleGUI as sg

layout = [ [sg.Button('Hello World3')] ]

window = sg.Window('This is a long heading.', layout)
while True:
    event, values = window.read()
    if event == sg.WIN_CLOSED or event == 'Close':
        break
    break
window.close()

Using method maximize of sg.Window after window finalized.

import PySimpleGUI as sg

layout = [ [sg.Button('Hello World3')] ]

window = sg.Window('This is a long heading.', layout, finalize=True)
window.maximize()

while True:
    event, values = window.read()
    if event == sg.WIN_CLOSED or event == 'Close':
        break
    break
window.close()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM