Some questions about drag-and-drop


I've been playing with drag and drop and, after some initial success, am stumped. I'm looking for advice.

As a first stab, to make my Big.Box draggable, I created it "reactive":

var box = new Big.Box ({reactive: true, ...});
global.stage.add_actor (box);

It is then made draggable via:

this.draggable = DND.makeDraggable (box);

I was surprised to discover that that was nearly enough to allow dragging that box around the desktop. However....

Dragging only works when in overview mode. When in normal mode, any click on the box passes through it to whatever is underneath. It's as if the click is not intercepted by the box itself. Is making it "reactive" not enough?

In going through the code in dnd.js, I noticed a reference to a "_delegate" in the method Draggable.startDrag(). It's a member of the actor passed to makeDraggable() -- the line is:

if ( && ...)

In the case at hand, is the box. That box doesn't have a _delegate property. Should it? If so, how is the _delegate added? What kind of object is a delegate?



'What did one snowman say to the other snowman?'
            - "Adrift", D. Hume -

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