CustomToolTip.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:beremiz 作者: nucleron 项目源码 文件源码
def GetToolTipSize(self):
        """
        Get tool tip size according to tip text and restriction
        @return: wx.Size(tool_tip_width, tool_tip_height)
        """
        max_width = max_height = 0

        # Create a memory DC for calculating text extent
        dc = wx.MemoryDC()
        dc.SetFont(self.Font)

        # Compute max tip text size
        for line in self.Tip:
            w, h = dc.GetTextExtent(line)
            max_width = max(max_width, w)
            max_height += h

        return wx.Size(max_width + 4, max_height + 4)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号