简体   繁体   English

tkinter:链接上的鼠标滞后

[英]tkinter: mouse lag on links

Writing an application in python/Tkinter, I sometimes have a page with a number of hyperlinks (defined by the class HyperlinkManager, in http://effbot.org/zone/tkinter-text-hyperlink.htm ). 在python / Tkinter中编写应用程序时,我有时会有一个包含许多超链接的页面(由HyperlinkManager类定义,在http://effbot.org/zone/tkinter-text-hyperlink.htm中 )。

I noticed that if a large number of links is present, the mouse develops a bit of lag when hovering on the links. 我注意到如果存在大量链接,鼠标悬停在链接上会产生一些滞后。 Do you know if this is typical in Tkinter apps, or if there are countermeasures? 您知道这在Tkinter应用程序中是否是典型的,或者是否存在对策?

alessandro 亚历山德罗

There is no particular slowness in Tkinter's handling of tag enter and leave bindings for a reasonable number of tags that I'm aware of, though there may be inefficiencies in the implementation of the HyperlinkManager class. 尽管在HyperlinkManager类的实现中可能效率低下,但是Tkinter处理标签进入和离开绑定对于我所知道的合理数量的标签没有特别缓慢。 And certainly, what you do with those enter/leave events can introduce some lag. 当然,你对那些进入/离开事件所做的事情可能会带来一些滞后。 Since entering and leaving can happen very rapidly, if the code is slow it will introduce some lag. 由于进入和离开可以非常快速地发生,如果代码很慢,则会引入一些滞后。

Is it possible for you to give a small example program that shows this lag that you're seeing? 您是否有可能提供一个小示例程序来显示您所看到的这种滞后?

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

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