通过事件 bind 更改 Text 的默认行为


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. class MyText(Text):
  2. def __init__(self, master, **kw):
  3. apply(Text.__init__, (self, master), kw)
  4. self.bind("<Return>", lambda e: "break")

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.