第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何使 tkinter 上的輸入文本區(qū)域變大?

如何使 tkinter 上的輸入文本區(qū)域變大?

qq_花開(kāi)花謝_0 2023-09-19 15:22:48
我正在開(kāi)發(fā)一個(gè)短信應(yīng)用程序,我用 tkinter 制作了一個(gè)簡(jiǎn)單的 GUI。它有 3 個(gè)輸入數(shù)據(jù)的字段和兩個(gè)按鈕。發(fā)件人接收者信息我想做的是使消息文本輸入比其他文本輸入更大,以便用戶有更多空間來(lái)編寫(xiě)消息(不是很大)。這是我的代碼:from tkinter import *def send_message():    print('sent')def clear_text():    print('cleared')#window objectapp = Tk()# SenderSender_text = StringVar()Sender_label = Label(app, text='Sender', font=('bold', 14), pady=20)Sender_label.grid(row=0, column=0, sticky=W)Sender_entry = Entry(app, textvariable=Sender_text)Sender_entry.grid(row=0, column=1)# ReceiverReceiver_text = StringVar()Receiver_label = Label(app, text='Receiver', font=('bold', 14))Receiver_label.grid(row=0, column=2, sticky=W)Receiver_entry = Entry(app, textvariable=Receiver_text)Receiver_entry.grid(row=0, column=3)# MessageMessage_text = StringVar()Message_label = Label(app, text='Message', font=('bold', 14))Message_label.grid(row=1, column=0, sticky=W)Message_entry = Entry(app, textvariable=Message_text)Message_entry.grid(row=1, column=1)# Buttonssend_btn = Button(app, text='Send', width=12, command=send_message)send_btn.grid(row=2, column=0, pady=20)clear_btn = Button(app, text='Clear', width=12, command=clear_text)clear_btn.grid(row=2, column=1)app.title('SMS')app.geometry('430x145')#startapp.mainloop()
查看完整描述

1 回答

?
Cats萌萌

TA貢獻(xiàn)1805條經(jīng)驗(yàn) 獲得超9個(gè)贊

您可以使用 Text() 而不是 Entry()。Text() 大小很容易改變。


from tkinter import *


def send_message():

    print('sent')


def clear_text():

    print('cleared')


#window object

app = Tk()

# Sender

Sender_text = StringVar()

Sender_label = Label(app, text='Sender', font=('bold', 14), pady=20)

Sender_label.grid(row=0, column=0, sticky=W)

Sender_entry = Entry(app, textvariable=Sender_text)

Sender_entry.grid(row=0, column=1)

# Receiver

Receiver_text = StringVar()

Receiver_label = Label(app, text='Receiver', font=('bold', 14))

Receiver_label.grid(row=0, column=2, sticky=W)

Receiver_entry = Entry(app, textvariable=Receiver_text)

Receiver_entry.grid(row=0, column=3)

# Message

Message_text = StringVar()

Message_label = Label(app, text='Message', font=('bold', 14))

Message_label.grid(row=1, column=0, sticky=W)

#Message_entry = Entry(app, textvariable=Message_text)

Message_entry = Text(app, width=20, height=2, font=("Bold",20))

Message_entry.grid(row=1, column=1)

# Buttons

send_btn = Button(app, text='Send', width=12, command=send_message)

send_btn.grid(row=2, column=0, pady=20)

clear_btn = Button(app, text='Clear', width=12, command=clear_text)

clear_btn.grid(row=2, column=1)



app.title('SMS')

app.geometry('430x145')


#start

app.mainloop()


查看完整回答
反對(duì) 回復(fù) 2023-09-19
  • 1 回答
  • 0 關(guān)注
  • 122 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)