Re: [gtk-list] RE: Problem with text widget



O'CONNOR, Steve wrote:
> 
> I think that you have hit the common problem of not realizing the widget
> before use.
> 
> I dont think that there is a single programmer using GTK that has not
> run into this problem. Think of it as a rite of passage rather than any
> stupidity on your part. I will attempt to
> explain the subtle nature of this problem ....


OK, it works now: I've put the set_text function *after* I show
all the windows - you don't need the gtk_widget_realize in that case,
of course.

I've tried to spot which call had to be made in my code so that
I can start writing in my text widget - in my code, it seems so 
be the line:
     gtk_container_add (GTK_CONTAINER (window), mainbox); 

Is this correct? For example:if I do:

    gtk_container_add (GTK_CONTAINER (window), mainbox); 
    gtk_widget_realize(text);
    gtk_text_insert (GTK_TEXT (text), NULL, NULL, NULL, "ca marche",-1); 

it works, but if I do:

    gtk_text_insert (GTK_TEXT (text), NULL, NULL, NULL, "ca marche
pas",-1); 
    gtk_widget_realize(text);

it doesn't.


BTW, this explanation should go straight into the GTK tutorial _
Ian Main, are you around?

Thanks a lot 


manu



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