#include <gtk/gtk.h>

int
main (int argc,
      char *argv[])
{
  if (gtk_init_check (&argc, &argv))
    {
      GtkWidget     *win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
      GtkWidget     *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
      GtkWidget     *sw2 = gtk_scrolled_window_new (NULL, NULL);
      GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw2));
      GtkWidget     *sw1 = gtk_scrolled_window_new (NULL, adj);
      GtkWidget     *tv1 = gtk_text_view_new ();
      GtkWidget     *tv2 = gtk_text_view_new ();
      GtkTextBuffer *tb2 = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tv2));

      gtk_text_buffer_set_text (tb2, "Start\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nFinish\n", -1);

      gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw1), GTK_POLICY_NEVER, GTK_POLICY_EXTERNAL);
      gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw2), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);

      gtk_container_add (GTK_CONTAINER (sw1), tv1);
      gtk_container_add (GTK_CONTAINER (sw2), tv2);

      gtk_box_pack_start (GTK_BOX (box), sw1, TRUE, TRUE, 0);
      gtk_box_pack_start (GTK_BOX (box), sw2, TRUE, TRUE, 0);

      gtk_container_add (GTK_CONTAINER (win), box);

      gtk_widget_show_all (win);

      /* User closes a text view */
      gtk_widget_destroy (sw1);

      g_signal_connect (win, "destroy", G_CALLBACK (gtk_main_quit), NULL);
      gtk_main ();
    }

  return 0;
}
