Device context errors running gr-wxgui gl versions on Mac OS X 10.6.4

Hi,
After building GNU Radio 3.3 next branch from sources, and
wxPython-2.8.11.0 unicode version binary installation package, the nongl
versions located in the gr-wxgui/src/python work fine, but all the gl
versions of the programs crash with a device context error:

$ python scopesink_gl.py

input rate 1000000.0 v_scale None t_scale 3e-05
Traceback (most recent call last):
File
“/Users/elvis/Tool/gnuradio-next/gr-wxgui/src/python/plotter/plotter_base.py”,
line 187, in _on_paint
for fcn in self._draw_fcns: fcn1
File
“/Users/elvis/Tool/gnuradio-next/gr-wxgui/src/python/plotter/plotter_base.py”,
line 59, in draw
self._draw()
File
“/Users/elvis/Tool/gnuradio-next/gr-wxgui/src/python/plotter/grid_plotter_base.py”,
line 204, in _draw_grid
for tick in self._get_ticks(self.x_min, self.x_max, self.x_step,
self.x_scalar)]
File
“/Users/elvis/Tool/gnuradio-next/gr-wxgui/src/python/plotter/grid_plotter_base.py”,
line 302, in _get_tick_label
return gltext.Text(tick_str, font_size=TICK_TEXT_FONT_SIZE)
File
“/Users/elvis/Tool/gnuradio-next/gr-wxgui/src/python/plotter/gltext.py”,
line 340, in init
self._initText()
File
“/Users/elvis/Tool/gnuradio-next/gr-wxgui/src/python/plotter/gltext.py”,
line 376, in _initText
self._centered)
File
“/Users/elvis/Tool/gnuradio-next/gr-wxgui/src/python/plotter/gltext.py”,
line 73, in init
self.createTexture()
File
“/Users/elvis/Tool/gnuradio-next/gr-wxgui/src/python/plotter/gltext.py”,
line 160, in createTexture
ow, oh = dc.GetMultiLineTextExtent(self._text)[:2]
File
“//usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_gdi.py”,
line 3774, in GetMultiLineTextExtent
return gdi.DC_GetMultiLineTextExtent(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion “Ok()” failed at
/BUILD/wxPython-src-2.8.11.0/src/common/dcgraph.cpp(880) in
DoGetTextExtent(): wxGCDC(cg)::DoGetTextExtent - invalid DC
Terminated

Best regards,

Elvis

Hi,
After doing some digging around, it would appear that there is a
problem with using a MemoryDC to get text extents.

In the file gr-wxgui/src/python/plotter/gltext.py, line number 160, the
call to GetMultiLineTextExtent fails.

ow, oh = dc.GetMultiLineTextExtent(self._text)[:2]

I tried using

ow, oh = dc.GetTextExtent(self._text)[:2]

as suggested by the report here: http://trac.flipturn.org/ticket/620

but that also failed.

Since I was eager to see if gnuradio and wxPython-2.8, manually compiled
to run natively using carbon framework (to avoid getting into the OpenGL
API context call changes in wxPython-2.9), I simply over-rode the
variables :

    ow = 10
    oh = 10

to just test to see if OpenGL was working, and sure enough, it works!!
:slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs