[英]How to I change text position on a frame in Tkinter
而是一個特定的請求,我似乎找不到任何在線文檔:
我正在嘗試更改按鈕周圍框架上字體的 position。 如下所示,文本當前位於按鈕上方的中心。 我希望文本顯示在按鈕的右側。
這是我的框架和按鈕代碼:
"""Button frames"""
constituent_frame = LabelFrame(root, text="Fibre and resin data inputs", padx=2, pady=2)
ply_frame = LabelFrame(root, text="Single lamina data inputs", padx=2, pady=2)
laminate_frame = LabelFrame(root, text="Complete ply stack data inputs", padx=2, pady=2)
"""Frame positions"""
constituent_frame.grid(row=2, column=1, padx=50)
ply_frame.grid(row=3, column=1, padx=50)
laminate_frame.grid(row=4, column=1, padx=50)
"""Button definitions"""
constituent_button = Button(constituent_frame, text='Constituent', width=15, command=click_constituent)
ply_button = Button(ply_frame, text='Ply', width=15, command=click_ply)
laminate_button = Button(laminate_frame, text='Laminate', width=15, command=click_laminate)
"""Button positions"""
constituent_button.grid(row=2, column=1, pady=2)
ply_button.grid(row=3, column=1, pady=2)
laminate_button.grid(row=4, column=1, pady=2)
任何建議或資源鏈接將不勝感激。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.