[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] Creating GUI widgets OOT using C++
From: |
Sylvain Munaut |
Subject: |
[Discuss-gnuradio] Creating GUI widgets OOT using C++ |
Date: |
Tue, 24 Sep 2013 15:31:43 +0200 |
Hi,
I'm currently attempting to create an OOT WX widget. And I'm facing
some issue with SWIG (I think).
The "make" method looks like this :
wx::sptr wx::make(wxWindow* parent)
And the GRC .xml gives as the first argument the 'top_level' (like in
other wx elements), which is of the type :
<grc_gnuradio.wxgui.panel.Panel; proxy of <Swig Object of type
'wxPanel *' at 0x3ab9440> >
and wxPanel is indeed a subclass of wxWindow, however I get :
Traceback (most recent call last):
File "./top_block.py", line 55, in <module>
tb = top_block()
File "./top_block.py", line 32, in __init__
self.guitest_wx_0 = guitest.wx(self.GetWin())
File
"/opt/gnuradio-3.7/lib64/python2.7/site-packages/guitest/guitest_swig.py",
line 111, in make
return _guitest_swig.wx_make(*args, **kwargs)
TypeError: in method 'wx_make', argument 1 of type 'wxWindow *'
So my guess is that SWIG somehow needs to know where/what/how about
the wx vs wxPython relation ship ... but I have no idea how.
Everything I tried so far resulted in a bunch of errors.
For examples, trying to %import the "window.i" from
/usr/include/wx-2.8/wx/i_files/ results in a bunch of errors like :
/usr/share/swig/2.0.9/std/std_vector.i:87: Error: Can't copy typemap
(directorout) std::vector< size_t,std::allocator< size_t > > =
std::vector< size_t,std::allocator< size_t > > &DIRECTOROUT
So has anyone ever done something like this ?
Even if I manage to create it, the next issue I face is the threading
model. I'm playing with OpenGL and OpenCL and essentially everything
needs to run from one single thread (which ever was used to create the
GL context), and I'm not really sure how to ensure that as a wx
widget.
Cheers,
Sylvain Munaut
PS: I'll also need to do the same for Qt as well a bit later so if you
have any example of that, feel free to share. Although given it's
already C++ in the base widgets, I hope it'll be easier. The threading
issue will be the same though, so if you have info on that, please
share.
- [Discuss-gnuradio] Creating GUI widgets OOT using C++,
Sylvain Munaut <=