Paste() public static method

public static Paste ( IProject project, Gtk seldata ) : Widget
project IProject
seldata Gtk
return Stetic.Wrapper.Widget
Example #1
0
        static void ClipboardPaste(Gtk.Clipboard clipboard, Gtk.SelectionData seldata)
        {
            Stetic.Wrapper.Container parent = Stetic.Wrapper.Container.LookupParent(target);
            if (parent == null)
            {
                return;
            }

            Stetic.Wrapper.Widget wrapper = WidgetUtils.Paste(parent.Project, seldata);
            if (wrapper == null)
            {
                return;
            }

            parent.PasteChild(target, wrapper.Wrapped);
            target = null;
        }
Example #2
0
        static void FaultDragDataReceived(object obj, Gtk.DragDataReceivedArgs args)
        {
            Stetic.Wrapper.Widget dropped = null;

            Stetic.Wrapper.Widget faultOwner = Stetic.Wrapper.Widget.Lookup((Gtk.Widget)obj);
            if (faultOwner != null)
            {
                dropped = WidgetUtils.Paste(faultOwner.Project, args.SelectionData);
            }
            Gtk.Drag.Finish(args.Context, dropped != null,
                            dropped != null, args.Time);
            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);
            }
        }