Blob Blame History Raw
From cbc1d8036f973108a2f7f8cfcc0c526f2e93c29b Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Wed, 28 Jan 2015 23:35:41 -0500
Subject: [PATCH] Fix gnuradio for wxPython3/GTK+3

MemoryDC needs to have a bitmap selected before using it
---
 gr-wxgui/python/wxgui/plotter/gltext.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gr-wxgui/python/wxgui/plotter/gltext.py b/gr-wxgui/python/wxgui/plotter/gltext.py
index 0b6e3f5..55627bc 100644
--- a/gr-wxgui/python/wxgui/plotter/gltext.py
+++ b/gr-wxgui/python/wxgui/plotter/gltext.py
@@ -149,6 +149,10 @@ class TextElement(object):
         # get a memory dc
         dc = wx.MemoryDC()
 
+        # Select an empty bitmap into the MemoryDC - otherwise the call to
+        # GetMultiLineTextExtent() may fail below
+        dc.SelectObject(wx.EmptyBitmap(1,1))
+
         # set our font
         dc.SetFont(self._font)
 
-- 
2.2.2