[Python] Como aumento o tamanho do espaço que ´sg.Text´ deixando um 'display' maior em relação...

Discussão em 'Python' iniciado por Stack, Setembro 10, 2024.

  1. Stack

    Stack Membro Participativo

    Quero que no sg.Text ele fique maior porque estou querendo tentar fazer uma calculadora com varios botoes tipo '1', '2',... e preciso saber como que deixo o texto maior para ficar mais "alocado" na tela. Deixar ele mais largo e mais alto.

    from PySimpleGUI import PySimpleGUI as sg

    #layout
    sg.theme('darkamber')
    layout = [
    [sg.Text("Primeiro valor"), sg.Input(key='val1')],
    [sg.Text("Segundo valor"), sg.Input(key='val2')],
    [sg.Button("Somar", key='somar')]
    ]
    #janela
    janela = sg.Window('Calculadora PSG', layout)
    #Ler os dados
    while True:
    eventos, valores = janela.read()
    if eventos == sg.WINDOW_CLOSED:
    break
    if eventos == 'somar':
    resultado = float(valores['val1']) + float(valores['val2'])
    sg.popup(f"""
    O resultado é {resultado}
    """)

    janela.close()

    Continue reading...

Compartilhe esta Página