problems updating statusbar



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi all,

i have a problem with the code fragment below. i seem to miss something
very basic.

'doit()' may take a long time. to give to user some feedback i want to
display "start" in the statusbar before starting with 'doit()'.
after 'doit()' returns i want to update the statusbar. the problem is
that i never see the "start" message. the whole processing of the status
bar (push "start", pop "start", push "stop") seems to take place when
process returns. yes, i verified that "start" is pushed onto the stack.

what am i missing? / how do i achieve the desired effect?


void
process (GtkWidget * widget, gpointer data)
{

  gtk_statusbar_push (GTK_STATUSBAR (status_bar),
                      (guint) & data, "start");

  /* update status bar. show "start" */
  gdk_window_process_updates (status_bar->window, TRUE);

  doit ();  /* this takes long */

  /* update status bar. pop "start", then show "stop" */
  gtk_statusbar_pop (GTK_STATUSBAR (status_bar), (guint) & data);
  gtk_statusbar_push (GTK_STATUSBAR (status_bar),
                      (guint) & data, "stop");

  return;
}

thanks in advance

please cc me, i am not subscribed)

- --
Dr. Ivo Alxneit
Laboratory for Solar Technology   phone: +41 56 310 4092
Paul Scherrer Institute             fax: +41 56 310 2688
CH-5232 Villigen                   http://solar.web.psi.ch
Switzerland                   gnupg key: 0x515E30C7

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkmYFLwACgkQAd7CE1FeMMeM4wCfXKFSiPYhG2mo3tY1GrDvS1Pr
tvIAn3CeRpBelNqW10dpzKNlSRUSGBSQ
=k/E9
-----END PGP SIGNATURE-----



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