Re: blocked gui - threading problem?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm not sure if i understand your problem right, but probably, solution
what are you finding is Glib::Dispatcher, it's easy to use, simple
create dispatcher, connect some method to it and from your thread call
the dispatcher like this:

// somewhere in class declaration
Glib::Dispatcher    signal_log;

// somewhere in constructor
signal_log.connect(sigc::mem_fun(*this, &MainWindow::process_log));

// somewhere in thread function
signal_log();

Just look to Documentation, there is example here. When you try to
change widget parameter (color, position etc) from thread, even if you
are using mutex or gtk+ lock functions, main thread ignore request to
redrawing it. But when this request is send via dispatcher all works
right. I use it for increasing or decreasing progress bar from threads.

Daniel Hornung napsal(a):
> Hello everyone!
> I have the following problem, I hope I can make myself clear (I'm quite new to
> gtkmm, so maybe my problems seem trivial to you).  I have written a small gui
> for a little board game, which most times works fine.  But sometimes the
> windows aren't redrawn when they should, everything just hangs and "painted
> over" areas are simply gray.

- --
Ondrej Tuma

Unix-like system is the best operation system from the top of the world.
I'm lucky BSD and linux user. :) Use unix-like, be free. :)

www.blackmouse.biz       www.radioakropolis.cz            hash.webjet.cz
ICQ: 107760454          JABBER: mcbig jabber cz   MSN: ondra tu atlas cz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGm2beBmNIPxOnb/IRAlB2AKCzo9sR/FIJfF34NSMgnNWzb8XohACgvv9k
AwitLr0KzxMh+XbUgRV+yFs=
=YhlU
-----END PGP SIGNATURE-----



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