Drop() public static method

public static Drop ( Gdk ctx, Gtk target, uint time ) : Gtk.Widget
ctx Gdk
target Gtk
time uint
return Gtk.Widget
Exemplo n.º 1
0
        static void FaultDragDrop(object obj, Gtk.DragDropArgs args)
        {
            Gtk.Widget            w       = DND.Drop(args.Context, (Gtk.Widget)obj, args.Time);
            Stetic.Wrapper.Widget dropped = Stetic.Wrapper.Widget.Lookup(w);
            if (dropped != null)
            {
                Gtk.Widget targetWidget = (Gtk.Widget)obj;
                int        px           = args.X + targetWidget.Allocation.X;
                int        py           = args.Y + targetWidget.Allocation.Y;

                FaultDrop(dropped, px, py, targetWidget);
                args.RetVal = true;
            }
        }
Exemplo n.º 2
0
        protected override bool OnDragDrop(Gdk.DragContext context, int x, int y, uint time)
        {
            Wrapper.ActionPaletteItem dropped = DND.Drop(context, null, time) as Wrapper.ActionPaletteItem;
            if (dropped == null)
            {
                return(false);
            }

            if (dropped.Node.Action.ActionGroup != group)
            {
                using (dropped.Node.Action.UndoManager.AtomicChange) {
                    dropped.Node.Action.ActionGroup.Actions.Remove(dropped.Node.Action);
                    group.Actions.Add(dropped.Node.Action);
                }
            }

            return(base.OnDragDrop(context, x, y, time));
        }