Forum: GNU Radio error using SetLabel

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
635b8cf1ca106f565815ca16ccc438ae?d=identicon&s=25 Matteo Campanella (Guest)
on 2007-01-19 16:29
(Received via mailing list)
Hello, I hope some wxWidgets / GNOME experts will know about this

I use the StaticText.SetLabel to change the value of a label at runtime
from a python callback from a custom block. Randomly I get this GNOME

Pango-ERROR **: file pango-layout.c: line 3230
(pango_layout_check_lines): assertion failed: (!layout->log_attrs)

Thinking that there was something wrong with changing the text of a
StaticText, I change the call into SetForegroundColour, but I have
exactly the same behaviour...

any hint?

best regards
Cec0a4bf0e0575f3a3171892e6097e59?d=identicon&s=25 Johnathan Corgan (Guest)
on 2007-09-25 22:30
(Received via mailing list)
On Sun, 2007-01-14 at 08:50 +0100, Matteo Campanella wrote:

> Pango-ERROR **: file pango-layout.c: line 3230
> (pango_layout_check_lines): assertion failed: (!layout->log_attrs)
> aborting...

I have had a very similar problem in the past.

I'd give it a high probability you are running into a threading issue.
wxWidgets is *not* reentrant, and updating controls from a thread
different from the one that is running the wxWidgets event loop will
create all sorts of problems eventually.

The solution is to create a custom wxWidgets event, then use wxPostEvent
in your GR call back function.  You then use a normal wxWidgets callback
function to handle that event to update the control.

This link has some slightly outdated notes on doing this from C++;
you'll have to translate them mentally to the wxPython domain:

It's a major pain, especially if you have to do it for several different
event types.  But the key difference is that wxWidgets main thread is
the one that is running and calling your wxWidgets event handler, so
there are no reentrancy issues.

I beat my head against the wall for a couple days on this once :-(

Johnathan Corgan, AE6HO
Corgan Enterprises LLC
635b8cf1ca106f565815ca16ccc438ae?d=identicon&s=25 Matteo Campanella (Guest)
on 2007-09-25 22:47
(Received via mailing list)
Thank you so much Johnatan for the hint - that was the problem indeed!!!
I followed the approach used in, encapsulating a gr message
in a wx DATA EVENT, letting the panel manage the data extraction and
presentation. It works fine now!

thank you very much
Matteo iz2eeq
This topic is locked and can not be replied to.