簡體   English   中英

Label 右側 tkinter window

[英]Label to the right side of the tkinter window

Label:“右文本”應在 tkinter window 的右側。 如圖像中突出顯示的那樣。

在此處輸入圖像描述

為此,我嘗試了下面的代碼,但它不在右側。

m_root = Tk()
m_root.wm_state('zoomed')

label_time = Label(m_root, text="Right Text", anchor="e", justify="right").grid()

m_root.mainloop()

label_time.pack(side="right",anchor="n")這可能有效。 anchor 將文本定位到右上角。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM