controls/CustomToolTip.py
branchwxPython4
changeset 3303 0ffb41625592
parent 2229 3c94bac4526e
child 3750 f62625418bff
--- a/controls/CustomToolTip.py	Thu Sep 02 21:36:29 2021 +0200
+++ b/controls/CustomToolTip.py	Thu Sep 02 22:18:14 2021 +0200
@@ -137,7 +137,7 @@
         max_width = max_height = 0
 
         # Create a memory DC for calculating text extent
-        dc = wx.MemoryDC(wx.EmptyBitmap(1, 1))
+        dc = wx.MemoryDC(wx.Bitmap(1, 1))
         dc.SetFont(self.Font)
 
         # Compute max tip text size
@@ -175,7 +175,6 @@
         dc.SetFont(self.Font)
 
         # Draw Tool tip
-        dc.BeginDrawing()
         tip_width, tip_height = self.GetToolTipSize()
 
         # Draw background rectangle
@@ -188,6 +187,5 @@
             _line_width, line_height = dc.GetTextExtent(line)
             line_offset += line_height
 
-        dc.EndDrawing()
 
         event.Skip()