Re: no joy...



Le 20/12/2011 23:52, Gary Kline a écrit :

thanks to those  who have tried to help, mostly off-list.  i can't
believe how hard this is.

i want to open a  base  window:

        gtk_window_set_title(GTK_WINDOW(window),"testing");
        gtk_widget_set_usize(GTK_WIDGET(window),200,300);

  ...

and then only a text window --upon button press-- and display
some text:


        text = gtk_text_view_new();
        gtk_container_add(GTK_CONTAINER(window),text);
        buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
"
and fopen some file and display the text in the buffer.  The   
question remains: how? what am i missing to display some
miscellaneous words in the text window?

You have the buffer, now the only needed thing is to load the data (I
assume you know how to do, right?) and add it to that buffer.  There is
some docs [1], but basically you want one of

        gtk_text_buffer_set_text()
        gtk_text_buffer_insert()
        gtk_text_buffer_insert_at_cursor()

Also, don't forget you have to show your widgets (gtk_widget_show()).


Cheers,
Colomban

[1] http://developer.gnome.org/gtk/stable/GtkTextBuffer.html



thanks in a advance.

gary

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




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