You could make your own window class that extends window (that is,
make a window that has all the attributes you've specified for the
window with id 'w1'), and then dynamically create instances of that.
Either that or you could do something like:
new window(canvas, {id:"clonew1", height:w1.height, width:w1.width,
title:w1.title, resizable:w1.resizable, closeable:w1.closeable});
using all the attributes you want to clone. Ideally, though, I'd go
with the class option, unless you need to clone changes that are made
to the window after its creation.
-JC
On Apr 26, 2007, at 9:01 PM, Tyler Frieling wrote:
hi,
Is there a way to clone an existing window instance? I tried a "new
window(canvas, idofwindowtoclone)" but it resulted in a window with
just the same title.
Ideally if I have this:
<window id="w1" x="50" y="50" width="${imageLoad.width
+imageLoad.width*0.20}" height="${imageLoad.width
+imageLoad.width*0.20}" title="Log in data" resizable="true"
closeable="true" layout="axis:x; spacing:20; inset:20">
<menubar name="mbar" placement="menubar">
<menu name="file" id="mfile" width="80">File
<menuitem text="Spawn"/>
<menuitem text="Store"/>
<menuitem text="Remove"/>
<menuseparator/>
<menuitem id="MWS" text="Send">
<menu name="subedit">subedit
<menuitem text="Email"/>
<menuitem text="Print"/>
</menu>
</menuitem>
</menu>
.........</window>
I would like the same window but with a different id:
<window id="clonew1" x="50" y="50" width="${imageLoad.width
+imageLoad.width*0.20}" height="${imageLoad.width
+imageLoad.width*0.20}" title="Log in data" resizable="true"
closeable="true" layout="axis:x; spacing:20; inset:20">
<menubar name="mbar" placement="menubar">
<menu name="file" id="mfile" width="80">File
<menuitem text="Spawn"/>
<menuitem text="Store"/>
<menuitem text="Remove"/>
<menuseparator/>
<menuitem id="MWS" text="Send">
<menu name="subedit">subedit
<menuitem text="Email"/>
<menuitem text="Print"/>
</menu>
</menuitem>
</menu>
.........</window>
tyler