GtkIconView: reorderable and enable_mode_drag_dest incompatible?



Hi, GTK gurus

this is driving me nuts. I am trying to set up an GtkIconView (with a
GtkListStore as data model), pretty standard stuff, gathered from
tutorials here and there.

My problem is that I can't manage to keep the thing reorderable *and*
accept drops from other apps. Here are the relevant lines:


  | static GtkTargetEntry droptypes[] = {
  |   {"image/png",  0, drp_image},
  |   {"STRING",     0, drp_string},
  |   {"text/plain", 0, drp_string}
  | };
  | #define NUMDROPTYPES (sizeof(droptypes)/sizeof(GtkTargetEntry))
  ...
  | board = GTK_ICON_VIEW(lookup_widget(toplevel, "board"));
  | gtk_icon_view_set_pixbuf_column (board, PIXBUF_COLUMN);
  | gtk_icon_view_set_text_column (board, TEXT_COLUMN);
  | gtk_icon_view_set_model (board, GTK_LIST_STORE(mkstore()));
 A| gtk_icon_view_set_reorderable (board, TRUE);
 B| gtk_icon_view_enable_model_drag_dest(board,
 B|                                      droptypes, NUMDROPTYPES,
 B|                                      GDK_ACTION_MOVE);

Set up this way, the GtkIconView "board" doesn't let the user move items
around with drag and drop (i.e. is not reorderable). But it accepts
drops from other apps (the signal callbacks get called).

If I exchange line A and lines BBB above, it's the opposite: reordering,
but no drops from external apps.

Can I have both?

My GTK version is 2.8.6

Thanks a bunch
-- tomás


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]