Text Widget con formato



I apologize for maybe a newbie question, the available documents don't
answer my question.

I need to read a formatted file (a text file produced by a C function,
formatted through fprintf)


         infile = fopen("./sholabo.txt", "r");
                            /*the formatted file to read from*/  
           if (infile){ 
            char buffer[1024]; 
            int nchars; 
            while (1)
           	{
             	nchars = fread(buffer, 1, 1024, infile);
             	gtk_text_insert (GTK_TEXT (text), NULL, NULL, 
                              NULL, buffer, nchars);
             	if (nchars < 1024)
               		break;
           }         
         fclose (infile);
       }

as given in the last tutorial available gives me a non formatted text in
the text widget. If I do printf("%s", buffer) after fred, it gives a
formatted text alright on the Xterm.

The question is: what do I have to do to the txt widget so that it shows
a formatted output?

Henry Gall





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