Re: About Treeview update with thread
- From: muppet <scott asofyet org>
- To: åçå <ruibotang gmail com>
- Cc: gtk-perl-list gnome org
- Subject: Re: About Treeview update with thread
- Date: Fri, 8 May 2009 23:20:19 -0400
On May 8, 2009, at 10:51 PM, åçå wrote:
hi,
In my project, The GUI have a treeview and a 'Run' Button,Treestore
may have thourands of datas.
When i click the 'Run' button, the logci will process the treestore
datas one by one(this is a long time procedure), when one data
process complete, i need to update the Treeview immediately.
In order to avoid the GUI lag, I use a thread to do the backend
processing. The problem is when the thread to update the Treeview,
the logic will fail.
- Remember to grab and release the gdk lock around the gui accesses
from the other thread, or
- Instead of immediately modifying the treemodel in your background
thread, install a single-shot idle that will do it. This effectively
defers the work to the main thread so that only one thread touches the
ui.
--
Sallah! I said no camels! That's five camels! Can't you count?
-- Indiana Jones
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]