/* gcc -o tvfocus tvfocus.c $(pkg-config --cflags --libs gtk+-2.0) */

#include <gtk/gtk.h>

int main (int   argc,
          char *argv[])
{
  GtkWidget *paned;
  GtkWidget *window;
  GtkWidget *tv1, *tv2;
  GtkListStore *ls1, *ls2;
  GtkTreeIter iter;
  GtkTreeViewColumn *col;
  GtkCellRenderer *text;

  gtk_init (&argc, &argv);

  ls1 = gtk_list_store_new (1, G_TYPE_STRING);
  gtk_list_store_append (ls1, &iter);
  gtk_list_store_set (ls1, &iter, 0, "foo", -1);
  gtk_list_store_append (ls1, &iter);
  gtk_list_store_set (ls1, &iter, 0, "bar", -1);

  ls2 = gtk_list_store_new (1, G_TYPE_STRING);
  gtk_list_store_append (ls2, &iter);
  gtk_list_store_set (ls2, &iter, 0, "foo", -1);
  gtk_list_store_append (ls2, &iter);
  gtk_list_store_set (ls2, &iter, 0, "bar", -1);

  tv1 = gtk_tree_view_new_with_model (GTK_TREE_MODEL (ls1));
  text = gtk_cell_renderer_text_new ();
  col = gtk_tree_view_column_new_with_attributes (NULL, text, "text", 0, NULL);
  gtk_tree_view_append_column (GTK_TREE_VIEW (tv1), col);

  tv2 = gtk_tree_view_new_with_model (GTK_TREE_MODEL (ls2));
  text = gtk_cell_renderer_text_new ();
  col = gtk_tree_view_column_new_with_attributes (NULL, text, "text", 0, NULL);
  gtk_tree_view_append_column (GTK_TREE_VIEW (tv2), col);

  paned = gtk_hpaned_new ();
  gtk_paned_pack1 (GTK_PANED (paned), tv1, TRUE, TRUE);
  gtk_paned_pack2 (GTK_PANED (paned), tv2, TRUE, TRUE);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_container_add (GTK_CONTAINER (window), paned);

  g_object_set (tv2, "can-focus", FALSE, NULL);

  gtk_widget_show_all (window);

  gtk_main ();

  return 0;
}
