Пример #1
0
        static void HandleDragScrolling(Widget w)
        {
            ScrolledWindow sw = (ScrolledWindow)w.GetAncestor(ScrolledWindow.GType);

            if (sw != null)
            {
                Drag.DestSetTrackMotion(w, true);

                DragMotionHandler dm = delegate(object o, DragMotionArgs args) {
                    int x, y;
                    Gdk.ModifierType mt;
                    sw.GdkWindow.GetPointer(out x, out y, out mt);
                    args.Args[1] = x;
                    args.Args[2] = y;
                    OnSwDragMotion(sw, args);
                };
                w.DragMotion -= dm;
                w.DragMotion += dm;
                Drag.DestSet(sw, DestDefaults.Motion, new TargetEntry[] {}, Gdk.DragAction.Move);
                Drag.DestSetTrackMotion(sw, true);
                sw.DragMotion -= OnSwDragMotion;
                sw.DragMotion += OnSwDragMotion;
            }
            else
            {
                Console.WriteLine("WARNING: No ScrolledWindow Container found: " + w.ToString());
            }
        }
Пример #2
0
        /// <summary>
        /// Creates a new <see cref="NodeView"/>.
        /// </summary>
        public NodeView()
        {
            CursorInit();

            HasWindow = false;
            SetSizeRequest(100, 100);

            Drag.DestSet(this, DestDefaults.Motion, null, DragAction.Private);
            Drag.DestSetTrackMotion(this, true);
        }