#include <gtk/gtk.h>


static gboolean delete_event(GtkWidget *widget,
			     GdkEvent  *event,
			     gpointer   data )
{
  gtk_main_quit ();
  return FALSE;
}

int main(int argc, char* argv[])
{

  GtkWidget *window, *view;
  GtkListStore *store;
  GtkCellRenderer *renderer;
  GtkTreeViewColumn *column;
  GtkTreeIter iter;

  gtk_init(&argc, &argv);
  
  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

  g_signal_connect(G_OBJECT (window), "delete_event",
		   G_CALLBACK (delete_event), NULL);

  store = gtk_list_store_new(1, G_TYPE_STRING);
  gtk_list_store_append(store, &iter);
  gtk_list_store_set(store, &iter,
		     0, "This is a row",
		     -1);
  
  view = gtk_tree_view_new();
  renderer = gtk_cell_renderer_text_new();
  column = gtk_tree_view_column_new_with_attributes("Title", renderer,
						    "text", 0,
						    NULL);
  gtk_tree_view_column_set_clickable(column, TRUE);
  gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
  
  gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store));

  gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store),
				       0,
				       GTK_SORT_ASCENDING);
  
  gtk_tree_view_column_set_sort_indicator(column, TRUE);
  gtk_tree_view_column_set_sort_order(column, GTK_SORT_ASCENDING);

  gtk_container_add(GTK_CONTAINER(window), view);
 
  gtk_widget_show_all(window);

  gtk_main();
  return 0;
}
