Re: GTK+ DND copy/move actions and tutorial



learfox furry ao net writes:

Hi, I'm putting two posts into here.

   A while back we put out an unofficial GTK+ DND tutorial (at
http://wolfpack.twu.net/docs/gtkdnd/index.html) we've been touching it up
and made a few corrections and one strange quirk we ran into is the move
and copy actions.

When setting a source widget to have both move and copy actions, the
default is always copy and as such, the user needs to hold down SHIFT to
change change it into a move.

   We were wondering if anyone knows of a way to specify both move and
copy but with move being the default?

The default is chosen by the destination. It does this based
on the ->actions and ->suggested_action fields of the GtkDragContext
in the ::drag_motion handler, and communicates its choice
back by calling gdk_drag_status.

(To control things at this level, you need to omit
GTK_DEST_DEFAULT_MOTION)

If ->actions contains multiple set bits, then the destination
can choose between them. ->suggested_action is the one suggested
by system policy, but the destination is free to override this
as appropriate.

If the user holds down a modifier key, then only one action
will appear in ->actions. In this case, the destination must
pick either that action or nothing (by calling gdk_drag_status
with an action of 0)

Regards,
                                        Owen





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