简体   繁体   English

基于输入字符数的 tkinter 输入命令?

[英]tkinter entry command based on number of characters entered?

Tkinter key binding using Tf.bind('<Return>', function) will trigger a function with the <Return> (Enter) key from the entry widget. Tkinter 键绑定使用Tf.bind('<Return>', function)将触发 function 与条目小部件中的<Return> (Enter) 键。 Is there a parameter that will trigger the function based on the number of characters entered within the entry widget?是否有一个参数会根据输入小部件中输入的字符数触发 function?

Thanks for your thoughts.谢谢你的想法。

Is there a parameter that will trigger the function based on the number of characters entered within the entry widget?是否有一个参数会根据输入小部件中输入的字符数触发 function?

No, there is not.不,那里没有。 Your bound function can easily check how many characters are in the widget and simply not do anything until the limit has been reached.您绑定的 function 可以轻松检查小部件中有多少个字符,并且在达到限制之前不做任何事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM