Re: [gtkmm] Using a despatcher to provide thread safe signals with parameters



Dan Alderman <d alderman 180sw com> writes:

> Hi,
>
> Can someone here please help me, I think I'm about to go mad.
>
> I have been looking at the examples provided within the gtkmm/sigc++ et
> al documentation but am still very confused.
>
> I have 3 distinct parts to a simple system, a GUI (view), some data (a
> model) and a "MegaManipulator" to manipulate the data (controller).  I
> have been using normal signals to notify a drawing area that the
> underlying data that it uses to draw itself has changed.  The underlying
> data is changed by the MegaManipulator in a separate thread created in
> main().  As I am now aware I cannot use normal signals when using
> threads and I need to use a Glib::Dispatcher.  Unfortunately this poses
> a problem for me.  The signal that I have been using sends 2 vital
> pieces of information, the location of the change and it's value (this
> saves redrawing the entire area which is a hex display of a byte
> array).  If I am to use a dispatcher I can no longer send this
> information because it is effectively a Slot0 type signal and not a
> Slot2 which is what I need.
>
> The SigC::bind method looked like it did what I wanted but it appears I
> can only bind static data and not variables.
>
> Can someone here provide some insight or examples showing me how I can
> achieve this?  I have looked at dispatcher.cc example which uses a
> Glib::Dispatcher but this doesn't provide any example on how to ship the
> data in a signal.
>
Please take a look at SigCX (http://libsigcx.sourceforge.net), I wrote
it exactly to solve this problem. The little hello_world example in
its docs (http://libsigcx.sourceforge.net/docs/sigcx_starting.html)
shows it's main features. The next release will feature an example
showing interaction with gtkmm; simply contact me if you need advice
on how to use SigCX.

Regards, Andy
-- 
Andreas Rottmann         | Rotty ICQ      | 118634484 ICQ | a rottmann gmx at
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

This reality is really just a fucked-up dream -- Papa Roach



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]