2016-02-25 29 views

回答

1

您需要做的就是將條目綁定到使用delete函數的函數。

def clear(event): 
    self.entry1.delete(0, END) 

self.entry1= Entry(self.mw,width=25,text=str1,justify=RIGHT,fg="red") 
self.entry1.insert(INSERT, "type here..") 
self.entry1.bind('<Button-1>', clear()) 
self.entry1.pack() 
+0

多數民衆贊成通過這種方式來刪除條目權限的文字,但我希望我的文字被清除後點擊輸入字段。我怎樣才能做到這一點? – eshi