by Clifton » Tue Jan 20, 2015 9:12 am
Why not just use several fields, which can be made draggable with createDraggableObject()? Initially they can be left hidden until they are needed in your application. Regarding naming them, just use PowerPac's userProperty() to create unique identifiers for each one that is relevant to your program.
If a rectangle needs a particular size and shape when shown, you could attach a stylesheet using pgExtFiles() and just set the class name of the rectangle from one in the stylesheet before it is shown. In this way you could even include graphics and other special effects and animations too. The userProperty() can set the class name of ToolBook objects and it works very nicely, though sometimes you have to use the "!important" expression in your stylesheet to override ToolBook's inline styles (that is, if you are manipulating one of them).
It is possible to clone objects, but it is unnecessarily complicated and events are lost in cloning. Whatever you are trying to accomplish will probably be more fun and interesting with the approach suggested, rather than doing down the road of cloning.