Re: [gtk-list] Managing long operations in a single-threaded application
- From: Tomi Ollila <Tomi Ollila tfi net>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Managing long operations in a single-threaded application
- Date: Tue, 24 Aug 1999 09:11:35 +0300 (EET DST)
Monday Aug 23 20:56:19 -0700 1999 Arthur Jerijian <firstname.lastname@example.org> wrote:
> Hi all,
> I need to perform a long operation, on the order of seconds or minutes, without
> freezing the entire GTK-based GUI that I'm using. This operation has no
> knowledge of GTK or its event messaging paradigm. Is there a way to perform
> this operation while still processing GTK messages in just one thread?
There are 2 possibilities:
1) Organize your code so, that you can return from it from time to time
and use gtk_idle_add() to return to the operation. In this case you must
put all local variables that you want to keep their value into a separate
structure that is given to the idle function as an argument.
2) Every now and then, do:
See GTK tutorial and GTK faq for more information.
] [Thread Prev