[Dojo-interest] How to destroy a shape but not all shapes on a surface?

Jamey Graham jameyg228 at yahoo.com
Fri Aug 5 11:59:16 EDT 2011


re: 1 - i believe you need to describe the new shape attrs w/ setShape() [vs. dojo.attr].  i.e. imgShape.setShape({src: newSrc})).  NOTE that under the covers (and perhaps needing to be documented) setShape() calls makeParameters() which I believe functions similar to setShape(dojo.mixin(getShape(), updatedAttrs)) [i.e. you only need to pass in the attrs that are changing...]  

re: 2 - there's Shape.removeShape(false) or Surface.remove(shape) [although i'm not sure how all renderers handle cleanup]


>________________________________
>From: zhang <uzhang at 263.net>
>To: dojo-interest at mail.dojotoolkit.org
>Sent: Friday, August 5, 2011 10:34 AM
>Subject: [Dojo-interest] How to destroy a shape but not all shapes on a surface?
>
>I need to display a image on the surface, and the src property needs to be
>changed frequently. 
>
>I think there should be two solutions:
>
>1) Change the src property dynamicly as this: 
>              dojo.attr(imgShape.shape, "src", "...");  
>    but it doesn't work.
>
>2) Remove and destroy the image shape, then recreate it with new src value.
>But I only know surface.destroy(), it will destroy all shapes on the
>surface. I didn't know how to destroy a single shape.
>
>Anybody can help? thanks. 
>
>--
>View this message in context: http://dojo-toolkit.33424.n3.nabble.com/How-to-destroy-a-shape-but-not-all-shapes-on-a-surface-tp3228858p3228858.html
>Sent from the Dojo Toolkit mailing list archive at Nabble.com.
>________________________________________________________
>Dojotoolkit: http://dojotoolkit.org
>Reference Guide: http://dojotoolkit.org/reference-guide
>API Documentation: http://dojotoolkit.org/api
>Tutorials: http://dojotoolkit.org/documentation
>
>Dojo-interest at mail.dojotoolkit.org
>http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20110805/9642df5c/attachment.htm 


More information about the Dojo-interest mailing list