Re: Updating TextView and StatusBar problem
- From: Olexiy Avramchenko <olexiy irtech cn ua>
- To: olliegator hortanet com
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Updating TextView and StatusBar problem
- Date: Mon, 05 Apr 2004 09:29:08 +0300
Hello,
When you use sleep() call you block your main events loop. You have to
use GLib timeouts istead of sleep.
http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html
Here's the sample (untested):
static gboolean delayed_print(gchar *text)
{
gchar *s;
print_textview(text, GTK_TEXT_VIEW(window->textview));
s = g_strconcat(" Just printed", text, NULL);
print_statusbar(s, GTK_STATUSBAR(window->statusbar));
return FALSE;
}
static void my_func()
{
print_textview("BLA\n", GTK_TEXT_VIEW(window->textview));
print_statusbar(" Just printed BLA", GTK_STATUSBAR(window->statusbar));
g_timeout_add(1000, delayed_print, "BLE\n");
}
Olexiy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]