Re: GtkIconView: reorderable and enable_mode_drag_dest incompatible? [RESOLVED]



On Fri, Jun 02, 2006 at 03:06:30PM +0000, tomas tuxteam de wrote:
Answering to my own question (again):
[...]
So the answer seems to be "yes, but only if you do all by hand".

Not that bad after all. Just enable the icon view's model as source and
destination. Make sure "GTK_TREE_MODEL_ROW" is included in the
acceptable types -- when coming from the same widget, like so:

  | typedef enum {
  |   drop_internal,
  |   drop_image,
  |   drop_string
  | } drooptype;
  | 
  | static GtkTargetEntry droptypes[] = {
  |   {"GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, drop_internal},
  |   {"image/png",  0, drop_image},
  |   {"STRING",     0, drop_string},
  |   {"text/plain", 0, drop_string}
  |   /* other types may go here */
  | };
  | 
Then
  | 
  |   gtk_icon_view_enable_model_drag_source(board,
  |                                          GDK_BUTTON1_MASK,
  |                                          droptypes,
  |                                          G_N_ELEMENTS(droptypes),
  |                                          GDK_ACTION_MOVE);
  | 
  |   gtk_icon_view_enable_model_drag_dest(board,
  |                                        droptypes,
  |                                        G_N_ELEMENTS (droptypes),
  |                                        GDK_ACTION_MOVE);

All is well now.

Regards
-- tomás


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