#include static GtkTreeRowReference *rowref = NULL; static void row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data) { g_print ("creating a row ref for %s\n", gtk_tree_path_to_string (path)); rowref = gtk_tree_row_reference_new (model, path); } int main (int argc, char **argv) { GtkTreeIter iter; GtkListStore *store; gtk_init (&argc, &argv); store = gtk_list_store_new (1, G_TYPE_STRING); /* now connect real quick!! */ g_signal_connect (store, "row_inserted", G_CALLBACK (row_inserted_cb), NULL); /* and now we are totally hosed, yay! */ gtk_list_store_append (store, &iter); gtk_list_store_append (store, &iter); g_print ("hey, the rowref now points to: %s\n", gtk_tree_path_to_string (gtk_tree_row_reference_get_path (rowref))); return 0; }