-2
這是我寫的有兩個按鈕,並在我的GUI文本輸入的代碼:如何使用Python中的Tkinter將小部件放在一起?
#!/usr/bin/python
import Tkinter
from Tkinter import *
top = Tkinter.Tk()
b1 = Button (top, text = "Hack it!", height = 10, width = 20)
b2 = Button (top, text = " Clone! ", height = 10, width = 20)
t = Text(top,width=60,height=40)
b1.grid(row=0, column=0)
b2.grid(row=0, column=1)
t.grid(row=1)
top.mainloop()
但我想是這樣的:
我該怎麼辦? (文本條目上方的標籤也是理想的)
有什麼辦法讓文本條目只讀嗎?
您可以在這裏找到大部分Tkinter小部件的屬性和方法:http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html –