在特定坐标处的wxpython工具提示 [英] wxpython tooltip at specific coordinates

查看:342
本文介绍了在特定坐标处的wxpython工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到很多类似的问题,而这些答案是到目前为止让我感到困惑的

I have seen lots of similar questions and those answers are what has gotten me this far.

我有一个应用程序,其中所有对象都是通过DC创建的,因此它们都被绘制了. (我在定尺寸器和99%的时间定尺寸器ROCK上都有丰富的经验,但在这种情况下,DC是最佳答案.)因此,我想为绘制的每个元素提供一个工具提示,并在刷新屏幕和元素在工具提示也应移动的其他位置绘制.我的第一个尝试是为每个绘制的项目设置一个wx.Rect,但是遇到了挂起"的情况.如果我在正确的轨道上,我将附加一个代码示例,但是如果我要吠叫另外一棵树,请在我再把这根头发拔掉之前让我知道!!!

I have an application where all all object are created via DC, so they are all all drawn. (I have had much experience with sizers and 99% of the time sizers ROCK but in this case DC is the best answer.) So I want to have a tooltip for each element that is drawn and in the case the screen is refreshed and the element is drawn in a different location the tooltip should also move. My first attempt was with setting a wx.Rect for each drawn item, but I ran into a "hang" situation. If i was on the the right track track I will attach a code sample but if I should be barking up another tree please let me know before I pull anymore of this hair out my head!!!!

推荐答案

您应该尝试BalloonTip

http://wxpython.org/Phoenix/docs/html/lib.agw.balloontip.html

它将为工具提示创建一个新的Frame,并根据对象的坐标进行设置.

It creates a new Frame for the tooltip and sets it according to coordinates of the object.

这篇关于在特定坐标处的wxpython工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆