[問題] 想請教各位高手有關GUI的問題
我看書試了一下GUI的問題
class main:
def keyin(self, e):
inchars=self.enter.get()+e.char
self.one.delete(0,tk.END)
self.one.insert(0,inchars)
def __init__(self,root):
edfont=("Consolas", "16")
self.one = tk.Entry(root,text="",font=edfont, width=100)
self.enter = tk.Entry(root,text="",font=edfont, width=100)
self.enter.bind("<KeyPress>",self.keyin)
self.one.pack()
self.enter.pack()
self.enter.focus()
def dogui():
root = tk.Tk();
srh=main(root);
root.mainloop()
if __name__ == '__main__' :
dogui()
這樣子去跑了以後 會出現兩列
我可以在下面那列打任何字 上面那列都會顯示出我打的
可是我如果按"backspace"的話 上面那列不會跟著退
想請教版上高手 如果按"backspace" 上面那列也能跟著退的話
有甚麼方法嗎
還有一個小問題
就是我想要在下面那列前面顯示"輸入列"
上面那列顯示"顯示列"的話 需要加甚麼??
書上寫的Label 試了可是不太會
麻煩各位能幫我解惑 謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.36.79
→
05/11 12:40, , 1F
05/11 12:40, 1F
→
05/11 12:42, , 2F
05/11 12:42, 2F