Thank you very much for suggesting the popen() function as this is a nice clean way to add a external programs output to a gtk+ textview widget. I do intend to learn how to use pipes as this would give a real time output.
Here is a example code for that maybe helpful for people learning. It does require a pointer to a real textview1 widget to work.
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview1));
fp = popen("ls -a", "r");
while ( fgets( line, sizeof line, fp))
gtk_text_buffer_get_end_iter (buffer, &iter);
gtk_text_buffer_insert (buffer, &iter, line, -1);