グリッドレイアウトを使用する際に問題をスケーリングのTkinter

デフォルトでは、グリッド・メンバーは、スケーリングされません。

キーズーム:

rowconfigure()
columnconfigure()

サンプルコード:
TKのようなインポートのTkinter 
TTKとしてインポートtkinter.ttk

勝利= tk.Tk()
win.title( "CommunicationTool")
win.rowconfigure(1、重量= 1)
win.columnconfigure(0、重量= 1)
#setting
setFrame = TK .LabelFrame(勝利、テキスト= "設定")
setFrame.columnconfigure(2、重量= 1)
comLable = tk.Label(setFrame、テキスト= "COMポート:").grid(行= 0、列= 0)
comSpiner = tk.Spinbox(setFrame、テキスト= "COM1")。グリッド(行= 0、列= 1、スティッキー= tk.EW)
refrashButton = ttk.Button(setFrame、テキスト= "更新")。グリッド(行= 0、カラム= 2、スティッキー= tk.W)
inputLable = tk.Label(setFrame、テキスト= "コマンド").grid(行= 1、列= 0)
inputEntry = tk.Entry(setFrame).grid(行= 1カラム= 1、スティッキー= tk.EW、columnspan = 2)
sendButton = ttk.Button(setFrame、テキスト= "送信")。グリッド(行= 1、カラム= 3)
setFrame.grid(行= 0、スティッキー= tk.EW)
#output
outputFrame = tk.LabelFrame(勝利、テキスト= "出力")
outputFrame.rowconfigure(0、重量= 1)
outputFrame.columnconfigure(0、重量= 1)
面積= tk.Text(outputFrame).grid(行= 0、スティッキー= tk.NSEW)
outputFrame.grid(行= 1、スティッキー= tk.NSEW)

win.mainloop()

デフォルト:

効果を最大にするには:

おすすめ

転載: www.cnblogs.com/real-bert/p/11569198.html