GtkTextView - delay with printing text.



Hi,
I got a problem with this TextView. I have a function like this one :

void put_text_to_widget(struct ircelements *ie, struct recv *r)
{
         /* Here i also tried to put 
gtk_text_buffer_insert_at_cursor(ie->buffer, r->what, i); but with the same 
result. */
        int i=0;
        switch(r->dot_state)
        {
                case 0:
                        break;
                case 1:
                        if(r->c_state==1 && strncmp(r->where, ie->label, 
32)==0)
                        {
                                if(strncmp(r->action, "PRIVMSG", 7)==0)
                                        {
                                                i=strlen(r->what);
                                                printf("checkpoint 1\n");
                                               
gtk_text_buffer_insert_at_cursor(ie->buffer, r->what, i);
                                                printf("checkpoint 2\n");
                                        }
                        }
                        break;
        }


}

And now i have in stdout:

checkpoint 1
checkpoint 2

but there is no text in GtkView. It appears after few seconds. Can anybody 
explain me why it happens and what how to fix it ?
Other thing is that when i call gtk_text_buffer_insert_at_cursor(ie->buffer, 
r->what, -1) outside this function eveything works good - there is no delay.
-- 
Regards,
Jan Opacki



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