|Subject:||Re: [Discuss-gnuradio] wxWidget for Header Visualization|
|Date:||Wed, 16 Dec 2015 18:18:43 +0100|
|User-agent:||Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0|
I'm really not very proficient with the WX GUI stuff; I'd have to try out and look through the source code. Really, WX is a bit outdated and *will* be removed at one point from GNU Radio, so you might really fare better in the long run using Qt if you want to modify things.
Now, call backs from C++ to python are possible, in principle, but doing that is a lot more complex, as it involves considerations like how to coordinate access to the single python interpreter from all the different threads GNU Radio will spawn at run time (GNU Radio runs every block in its own thread). The way WX and Qt do their C++->Python calls is pretty specific to their UI toolkits, so this will be a rather complex thing to do "correctly".
Generally, I recommend avoiding manually calling python code from C++, or generally, avoiding directly calling things in other blocks or the GNU Radio runtime from your blocks, unless you know it's safe to do so; in many cases, a much more elegant and much easier solution can be implemented, for example using GNU Radio's message passing.
Maybe you want to explain what you want to do, calling Python from C++.
On 16.12.2015 17:49, Silvio Mazzaro wrote:
Hi Marcus, thank you for your answer. I've one more question for you :-) Is it possible to change the value of a Wx Slider, taking it from an incoming Header? For example I've a frequency field in the packet Header and I'd like to see it (real-time) setting the slider value.. I know how to set in the .grc a callback from Python to C++ but I'm having an hard time doing the reverse. Any example or URL could be precious for me, Thank you for your time, Silvio
|[Prev in Thread]||Current Thread||[Next in Thread]|