Re: How to update both the Console and the GTKMM gui window after running other functions



Jonas, the suggested approach that I sent earlier uses a dispatcher to avoid this problem, which I think is the preferred approach.  Also, the poster is trying to update a GUI window *asynchronously*.  He doesn't want to use timeouts, and he doesn't want it to be button driven.  I think that justifies the use of a separate thread.

-- Alan


On 8/1/2013 7:24 AM, Jonas Platte wrote:
It is quite simple to open another thread and call set_text of your label from there. The problem is that this will probably crash your program, as gtkmm is not thread-safe. That's why you need to make sure that your set_text doesn't overlap with the gtk main loop that updates the GUI.
And that is the thing complicated to implement. At least I think so. I never did this before, but you made me think about this once again and it raised my interest, so eventually I will come up with a solution later. Or somebody else will.



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