python - Tkinter showerror appears again when return is bound -
i have used root.bind("<return>",enter) calls function enter when return key (enter) pressed. function enter reads input field , might call tkmessagebox.showerror(header,text) depending on input. pressing return key both press ok on error , make tkmessagebox.showerror(header,text) appear again, despite next line after tkmessagebox.showerror(header,text) inputfield.delete(0,end).
this code:
enter(): showerror("error","wrong input") streckkodentry.delete(0,end) this solves it:
enter(): disable() showerror("error","wrong input") enable() streckkodentry.delete(0,end) where disable() removes binding , enable() puts back
this problem occur on machine debian 7.0 not windows machine. ideas how solve without adding disable/enable each showerror?
i found problem! had still defined binding bind_all rather bind. in windows not matter since error message blocks bind_all binding, error message can interacted with. debian 7.0 not block bind_all when error message appears , biding working behind error message well.
Comments
Post a Comment