Re: Use of threads with gtkmm.



On mån, 2005-04-11 at 14:17 -0400, Paul Davis wrote:
> >This excerpt from the FAQ sounds like what I'm after:
> >"or alternatively, ensure that only a single thread makes such calls.
> >One common way to do this is to have non-GUI threads send requests to
> >the GUI thread via a pipe. The pipe is hooked into the main glib event
> >loop used by GTK."
> >
> >But I've been unable to find any simple example code for this. Could anyone
> >provide a brief example?
> 
> there is no brief example. there's no "brief" way to do it. i would
> point at Ardour's ViewCVS system, but the code there is complicated by
> the fact that the code used has to be real-time safe, which will make
> it much harder for you to understand how it works.

There is a brief way. Use Glib::Dispatcher, which is a asynchronous
signal that uses a pipe. I'm not sure if there is an example program,
but this is a very common question.

-- 
Fredrik Arnerup <arnerup kth se>




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