Discussion:
[lively-kernel] Prototyping DND
Sean P. DeNigris
2014-02-18 21:17:10 UTC
Permalink
Can drag and drop behavior be implemented via scripts, or must you subclass
Morph?



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/Prototyping-DND-tp4744713.html
Sent from the Lively Kernel mailing list archive at Nabble.com.
Sean P. DeNigris
2014-02-18 21:33:36 UTC
Permalink
Post by Sean P. DeNigris
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.
Tim Felgentreff
2014-02-18 22:27:23 UTC
Permalink
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: lively-***@hpi.uni-potsdam.de
Subject: Re: [lively-kernel] Prototyping DND
Post by Sean P. DeNigris
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.
Sean P. DeNigris
2014-02-18 22:34:50 UTC
Permalink
Post by Tim Felgentreff
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
--
View this message in context: http://forum.world.st/Prototyping-DND-tp4744713p4744730.html
Sent from the Lively Kernel mailing list archive at Nabble.com.

Loading...