简体   繁体   English

我如何在 pysimplegui 中增加我的输入文本框?

[英]How I increase my box of inputText in pysimplegui?

I used size but nothing changed:我使用了 size 但没有改变:

input = [
    [sg.Text("Type your text")],
    [sg.InputText(key='text', size=(200,200))],
    [sg.Button("Sent")]
]

wInput = sg.Window("Exercicio Python", input, size=(400,450))

while True:
    events, values = wInput.read()
    if events == sg.WINDOW_CLOSED:
        break

What I have:我拥有的:

在此处输入图像描述

What I wanted:我想要什么:

在此处输入图像描述

在此处输入图像描述

I used :

    input = [
    [sg.Text("Type your text")],
    [sg.Multiline(key="texto", size=(50, 20))],
    [sg.Button("Sent")]
]
input = [
    [sg.Text("Type your text")],
    [sg.InputText(key='text', size=(200,200), expand_y=True)],
    [sg.Button("Sent")]
]

wInput = sg.Window("Exercicio Python", input, size=(400,450))

while True:
    events, values = wInput.read()
    if events == sg.WINDOW_CLOSED:
        break

The expand_y=boolean and expand_x=boolean will stretch the items in x width and y height. expand_y=boolean 和 expand_x=boolean 将拉伸 x 宽度和 y 高度的项目。 Try adding both to your InputText and the x to your button.尝试将两者都添加到您的 InputText 并将 x 添加到您的按钮。 Pls let me know if it worked for you;-)请告诉我它是否对您有用;-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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