I am helpless as I tried all day to find answer to this.
I am using GTK and C and on my application I have a Drag and drop feature. Code:
Code: Select all
icon_view = gtk_icon_view_new_with_model(create_and_fill_model(pALP));
g_object_unref(pALP->list_store); /* destroy model automatically with view */
gtk_icon_view_set_selection_mode(GTK_ICON_VIEW(icon_view), GTK_SELECTION_SINGLE);
gtk_icon_view_set_reorderable(GTK_ICON_VIEW(icon_view), TRUE);
gtk_icon_view_set_text_column(GTK_ICON_VIEW(icon_view), COL_DISPLAY_NAME);
gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(icon_view), COL_PIXBUF);
gtk_icon_view_set_tooltip_column(GTK_ICON_VIEW(icon_view), COL_TOOLTIP);
g_signal_connect(icon_view, "button-press-event", G_CALLBACK(icon_view_onButtonPressed), pALP);
g_signal_connect(icon_view, "item-activated", G_CALLBACK(icon_view_onItemActivated), pALP);
static GtkTreeModel * create_and_fill_model(AppLauncherPlugin * pALP)
{
MenuCacheDir* root_dir;
GtkTreeIter iter;
pALP->list_store = gtk_list_store_new(NUM_COLS, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
root_dir = menu_cache_get_root_dir(pALP->menu_cache);
if(root_dir)
fill_model_from_menu_cache(pALP, root_dir, &iter);
return GTK_TREE_MODEL(pALP->list_store);
}
I understand that in order to save the location of the drops I need to create a menu file and write some xml,
But how do I do this? it there another way?
I need help :/