#include <gtk/gtk.h>
void create_window();

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

	create_window();
	gtk_main ();

	return 0;
}

#ifdef _WIN32
#include <windows.h>
int APIENTRY WinMain( HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR lpCmdLine, int nCmdShow)
{
	return main( __argc, __argv );
}
#endif

void create_window()
{
	GtkWidget *window1;
	GtkWidget *treeview1;
	
	window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	gtk_window_set_title (GTK_WINDOW (window1), "test");
	gtk_widget_show (window1);
	g_signal_connect (window1, "destroy", G_CALLBACK (gtk_main_quit), NULL);

	GtkTreeStore* store = gtk_tree_store_new(1, G_TYPE_STRING);
	treeview1 = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
	gtk_container_add (GTK_CONTAINER (window1), treeview1);

	gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview1), FALSE);
	gtk_tree_view_set_enable_search(GTK_TREE_VIEW(treeview1), FALSE);
	gtk_widget_show (treeview1);

	//add column
	GtkTreeViewColumn *column = gtk_tree_view_column_new();
	GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
	gtk_tree_view_column_pack_start(column, renderer, TRUE);
	gtk_tree_view_column_set_attributes(column, renderer, "text", 0, NULL);

	// add the column to the view
	gtk_tree_view_append_column (GTK_TREE_VIEW(treeview1), column);

	//enable "drag and drop" reordering
	gtk_tree_view_set_reorderable(GTK_TREE_VIEW (treeview1), TRUE);

	//add some data
	GtkTreeIter  child;
	gtk_tree_store_append(GTK_TREE_STORE(store), &child, NULL);
	gtk_tree_store_set (GTK_TREE_STORE(store), &child, 0, "Node1", -1);
		
	gtk_tree_store_append(GTK_TREE_STORE(store), &child, NULL);
	gtk_tree_store_set (GTK_TREE_STORE(store), &child, 0, "Node2", -1);

	gtk_tree_store_append(GTK_TREE_STORE(store), &child, NULL);
	gtk_tree_store_set (GTK_TREE_STORE(store), &child, 0, "Node3", -1);
}
