Re: Update label immediately
- From: Simon Fuhrmann <NightSlayer gmx de>
- To: Johannes Bauer <dfnsonfsduifb gmx de>, gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Update label immediately
- Date: Sun, 20 Jul 2008 15:20:33 +0200
Johannes Bauer wrote:
> I'm writing an application which reads from a DMM (asynchronously, I'm
> using pthreads - is that a bad idea?)
I'm also using pthreads in my application. It might not be the best idea
(there are also Glib-Threads, which makes you application more portable)
but it works well. The rule of thumb which you should always have in
mind: You must not call a single Gtk function from any thread except the
main one (where you initialized Gtk). Note that emitting "regular"
signals also typically lead to Gtk function calls. I archive that by
using the Glib::Dispatcher (see the documentation about this, this is
not a "regular" signal) and fire an event to my main thread if the
asynchronous work is done. If you do this, you should never have
problems with GUI elements not updating.
Simon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]