我一直在谷歌上搜索這個問題,但沒有找到任何好的網站.... 我想創建按鈕和輸入小工具的樣子:Python的創建按鈕和Entry組件
[A] [ B] [C] [d] [E] [F]
[ENTRYWIDGET這裏] [OK]
我的代碼如下所示:
類控制器(幀):
def __init__(self,parent): Frame.__init__(self, parent) self.parent = parent self.button1 = Button(parent, text = "A") self.button1.pack(side = TOP) self.button1 = Button(parent, text = "B") self.button1.pack(side = TOP) self.button1 = Button(parent, text = "C") self.button1.pack(side = TOP) self.button1 = Button(parent, text = "D") self.button1.pack(side = TOP) self.button1 = Button(parent, text = "E") self.button1.pack(side = TOP) self.button1 = Button(parent, text = "F") self.button1.pack(side = TOP) self.myentrybox = Entry(parent, width = 50) self.myentrybox.pack(side = LEFT) self.button = Button(parent, text = "OK") self.button.pack(side = RIGHT)
,這看起來與我試圖創造完全不同的..
任何反饋會如此感激感謝。
您應將使用什麼庫放......我不認爲它WX ... –
你需要使用[佈局或形狀管理]之一(http://infohost.nmt.edu/tcc/ help/pubs/tkinter/layout-mgt.html)並告訴它如何安排你的小部件。 – martineau