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 k a 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()

Upvotes: 2

Views: 2766

Answers (1)

Jason Yang
Jason Yang

Reputation: 13061

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()

Upvotes: 2

Related Questions