Prototyping DND

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Prototyping DND

Sean P. DeNigris
Administrator
Can drag and drop behavior be implemented via scripts, or must you subclass Morph?
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Prototyping DND

Sean P. DeNigris
Administrator
Sean P. DeNigris wrote
Can drag and drop behavior be implemented via scripts
I see that making a dropOn script seems to hook into the drop handling. Can I call the dropOn method from the dropOn script? My naive attempt caused a stack overflow...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Prototyping DND

timfelgentreff
In reply to this post by Sean P. DeNigris
If you override dropOn, you need to use $super(evt) to call into the
original method.

A script is just an instance specific override. From: Sean P. DeNigris
Sent: 18/02/2014 22:34
To: [hidden email]
Subject: Re: [lively-kernel] Prototyping DND
Sean P. DeNigris wrote
> Can drag and drop behavior be implemented via scripts

I see that making a dropOn script seems to hook into the drop handling. Can
I call the dropOn method from the dropOn script? My naive attempt caused a
stack overflow...



-----
Cheers,
Sean
--
View this message in context:
http://forum.world.st/Prototyping-DND-tp4744713p4744714.html
Sent from the Lively Kernel mailing list archive at Nabble.com.
_______________________________________________
lively-kernel mailing list
[hidden email]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
_______________________________________________
lively-kernel mailing list
[hidden email]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
Reply | Threaded
Open this post in threaded view
|

Re: Prototyping DND

Sean P. DeNigris
Administrator
Tim Felgentreff-2 wrote
If you override dropOn, you need to use $super(evt) to call into the
original method.
Ahh, thank you. That did it:
this.addScript(function dropOn(morph) {
    alert('do this first');
    return $super(morph)
}).tag([]);
Cheers,
Sean