// gcc bug.c -o bug `pkg-config gtk+-3.0 --cflags --libs`
#include <gtk/gtk.h>

static void
print_hello (GtkWidget *widget,
             gpointer   data)
{
  g_print("Reordered columns\n");
}

int
main (int   argc,
      char *argv[])
{
  GtkWidget *window;
  GtkWidget *tree;
  GtkTreeViewColumn *column1, *column2;

  gtk_init (&argc, &argv);
  tree = gtk_tree_view_new ();
  gtk_widget_set_size_request (tree, 320, 240);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree), TRUE);
  column1 = gtk_tree_view_column_new_with_attributes ("column1", gtk_cell_renderer_text_new(), "width", 100 );
  column2 = gtk_tree_view_column_new_with_attributes ("column2", gtk_cell_renderer_text_new(), "width", 100 );

  gtk_tree_view_column_set_reorderable (column1, TRUE);
  gtk_tree_view_column_set_reorderable (column2, TRUE);

  gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column1);
  gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column2);
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
  g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
  gtk_container_add (GTK_CONTAINER (window), tree);
  gtk_widget_show (tree);
  gtk_widget_show (window);

  gtk_main ();

  return 0;
}

