wxpython tooltip at specific coordinates

北城余情 提交于 2020-01-06 15:08:40

问题


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

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!!!!


回答1:


You should try BalloonTip

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

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



来源:https://stackoverflow.com/questions/29059569/wxpython-tooltip-at-specific-coordinates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!