def SetToolTipPosition(self, pos):
"""
Set tool tip position
@param pos: New tool tip position
"""
# Get screen size to prevent tool tip to go out of the screen
screen_width, screen_height = wx.GetDisplaySize()
# Calculate position of tool tip to stay in screen limits
tip_width, tip_height = self.GetToolTipSize()
self.SetPosition(wx.Point(
max(0, min(pos.x, screen_width - tip_width)),
max(0, min(pos.y, screen_height - tip_height))))
评论列表
文章目录