Re: repainting GtkTextView



 Thanks for the reply --

 The code is already on a timeout_add call. Here is what I am doing.

  /* prototype */
  timeout_callback (...)  /* called every 10 sec or set by user */
  {
     while(open(file) == NULL)
     {
         /* can not open file on stupid windows 2K  --locked by pther process*/
        
         log_to_text_view_widget( " File is locked ..."); <== This does not
happen.
         sleep(1)  ;   /* wait to see if other proc closes the file */

         if( loop > 10 ) break; /* give up for now and come back later on
timeout. */        
     }

     /* when we reach here, the 10 messages from log_to_text_view_widget()
shows altogether. */

  }

  
--- Olexiy Avramchenko <ath beast stu cn ua> wrote:
Harring Figueiredo wrote:


The textview does not repaint until I leave the while loop. i.e.
it "hangs" on the while, once it leaves the while, the 10 messages apper on
the
text view.

How do I force it to print the message on the text view as soo as the
message
is available.

NOTE: YES, this is single thread app.

Just dont use sleep() - put your code in timeout function with 1 sec 
timeout.
Consider gtk_timeout_add, gtk_timeout_remove.

Olexiy

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com



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