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



Thanks Andy,

I am looking into this today, it may well be a better solution for us
than using separate thread safe queues (which I have to say, although
they work, seem a bit, well, just, icky).  I'm sure we will talk in the
future when we are being stupid and can't make it work :-)  Is there a
technical reason why the Dispatcher class in glibmm was implemented with
no provision for data passing with the signals?

D.

On Wed, 2003-04-23 at 21:22, Andreas Rottmann wrote:
> 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
-- 
=====================================================================
Dan Alderman                Software Engineer

OneEighty Software Ltd.     Phone: +44 20 8680 8712
Cygnet House                Fax: +44 20 8680 8453
12-14 Sydenham Road
Croydon                     Email: d alderman 180sw com
CR9 2ET
UK

Under the Regulation of Investigatory Powers (RIP) Act 2000 together
with any and all Regulations in force pursuant to the Act One Eighty
Software Ltd reserves the right to monitor any or all incoming or
outgoing communications as provided for under the Act.

Attachment: signature.asc
Description: This is a digitally signed message part



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