Python tkInter Entry fun

前端 未结 3 517
猫巷女王i
猫巷女王i 2020-12-10 09:02

Playing around with Python - tkInter - Entry widget - when I use validatecommand (below), the check happens the first time the string > Max, but when I continue to enter tex

3条回答
  •  鱼传尺愫
    2020-12-10 09:36

    From the Tk man:

    The validate option will also set itself to none when you edit the entry widget from within either the validateCommand or the invalidCommand. Such editions will override the one that was being validated. If you wish to edit the entry widget (for example set it to {}) during validation and still have the validate option set, you should include the command

    after idle {%W config -validate %v}

    don't know how to translate that to python.

提交回复
热议问题