#include #define LONG_TEXT "Some long text here. GTK+ is a library for creating " \ "graphical user interfaces. It works on many UNIX-like platforms, Windows, " \ "and on framebuffer devices. GTK+ is released under the GNU Library General " \ "Public License (GNU LGPL), which allows for flexible licensing of client " \ "applications. GTK+ has a C-based object-oriented architecture that allows " \ "for maximum flexibility. Bindings for other languages have been written, " \ "including C++, Objective-C, Guile/Scheme, Perl, Python, TOM, Ada95, Free " \ "Pascal, and Eiffeli." int main(int argc, char **argv) { GtkWidget *window; GtkWidget *tv; GtkTextBuffer *buff; gtk_init(&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); buff = gtk_text_buffer_new(NULL); gtk_text_buffer_set_text(buff, LONG_TEXT, strlen(LONG_TEXT)); tv = gtk_text_view_new_with_buffer(buff); gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(tv), GTK_WRAP_CHAR); gtk_container_add (GTK_CONTAINER (window), tv); gtk_widget_show_all(window); gtk_main (); return 0; }