HSG |
|
import tkinter as tk class View(tk.Tk): def __init__(self): tk.Tk.__init__(self) # Fenster self.title("Entry-Demo") self.geometry('240x80+400+100') # Entry self.eA = tk.Entry(self) self.eA.delete(0,tk.END) self.eA.insert(0,'Otto') self.eA.place(x=20,y=20,width=100) self.eA.bind('<Key-Return>',self.cbEntry) def cbEntry(self,event): self.focus_force() print('Return im Entry-Widget, String:',self.eA.get()) v = View() v.mainloop()