亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

錨點不適用于 Tkinter

錨點不適用于 Tkinter

蠱毒傳說 2023-08-08 17:53:35
我在框架中放置了一個復選按鈕??蚣艿摹皞让妗笔钦_的。我指定我的檢查按鈕位于錨點“中心”,但它位于右側。你知道如何解決這個問題嗎?謝謝from tkinter import * fenetre= Tk() cadreoptions=Frame(fenetre,width=100,height=70,borderwidth=2) cadreoptions.pack(side=RIGHT) statusnegatif=IntVar() negatifbutton= Checkbutton(cadreoptions,text='Négatif',variable=statusnegatif) negatifbutton.pack(padx=5,pady=2,anchor='center') fenetre.mainloop()
查看完整描述

1 回答

?
繁星coding

TA貢獻1797條經驗 獲得超4個贊

from tkinter import *


fenetre= Tk()

cadreoptions=Frame(fenetre,width=100,height=70,borderwidth=2)

cadreoptions.pack(side=RIGHT,expand=1)


statusnegatif=IntVar()

negatifbutton= Checkbutton(cadreoptions,text='Négatif',variable=statusnegatif)

negatifbutton.pack(padx=5,pady=2)


fenetre.mainloop()

您的相框上裝有您的標簽,無論您的相框走到哪里,標簽都會隨之而去。所以expand=1會讓你的框架調整大小。錨點默認是“center”,所以沒有必要。

查看完整回答
反對 回復 2023-08-08
  • 1 回答
  • 0 關注
  • 195 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號