controls/CustomToolTip.py
changeset 2229 3c94bac4526e
parent 1881 091005ec69c4
child 3303 0ffb41625592
equal deleted inserted replaced
2228:12cb48823b8c 2229:3c94bac4526e
   135         @return: wx.Size(tool_tip_width, tool_tip_height)
   135         @return: wx.Size(tool_tip_width, tool_tip_height)
   136         """
   136         """
   137         max_width = max_height = 0
   137         max_width = max_height = 0
   138 
   138 
   139         # Create a memory DC for calculating text extent
   139         # Create a memory DC for calculating text extent
   140         dc = wx.MemoryDC()
   140         dc = wx.MemoryDC(wx.EmptyBitmap(1, 1))
   141         dc.SetFont(self.Font)
   141         dc.SetFont(self.Font)
   142 
   142 
   143         # Compute max tip text size
   143         # Compute max tip text size
   144         for line in self.Tip:
   144         for line in self.Tip:
   145             w, h = dc.GetTextExtent(line)
   145             w, h = dc.GetTextExtent(line)