Re: Updating a statusbar widget



On Sun, 23 Jul 2000, Nicholas wrote:

 Hi, 

 See FAQ - Q4.12
The A is to insert the loop of sub_rout1 the following:

while (gtk_events_pending())
        gtk_main_iteration();

> hi people
> 
> imagine the following lines:
> 
> -----------------------------------
> int
> main(arg--etc) {
> 
>  gtk_init (&argc, &argv);
> 
>      window --bla-bla--
> 
> /* i create a statusbar */
> 
>  status_bar = gtk_statusbar_new();
>  gtk_box_pack_start (GTK_BOX (vbox), status_bar, TRUE, TRUE, 0);
>  gtk_widget_show (status_bar);
> 
>  context_id = gtk_statusbar_get_context_id(
>                     GTK_STATUSBAR(status_bar), "Statusbar example");
> 
> 
>  sub_rout1();    // i call a subroutine
> 
>  gtk_widget_show (window);
>  gtk_main ();
>  return(0)
> 
> }
> 
>  void sub_rout1 {
>     /* here is a loop */
>     for (bla bla) {
>         do smth;
>         sub_rout2();
>      }
>  }
> 
>  void sub_rout2 {
>     /* in here i'm trying to update the text in 'statusbar' widget */
>      gtk_statusbar_push( GTK_STATUSBAR(status_bar), GPOINTER_TO_INT(data),
> buff)
>      return;
>  }
> 
> --------------------------------------
> Well it doesn't work... exept when it exits from the loop the
> statusbar gets the last value.
> 
> Any way how to make the updated contents of the statusbar
> visible while in the loop?
> 
> thanks
> 
> N
> 
> 
> 
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list
> 

 Best regards,
  -Vlad





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