Hello,
What is the best way to dispose object ? In the bottom of this post, I have
added a sample.
My sample code is very simple :
- a button "OPEN WINDOW" is displayed in the main window.
- when click on this button, a modal window is displayed with a close
button.
- when the close button is clicked, the modal window is closed and I try at
this time to dispose the modal window to freeing memory.

My code doesn't work.

How/when dispose the modal window myWindow ? 
All children objects (btClose,myLabel) are disposed when modal window is
disposed ?

thanks for your help.

frederic


-------------------------------------------------------------------------------------

qx.OO.defineClass("custom.Application", qx.component.AbstractApplication,
function () {  qx.component.AbstractApplication.call(this);});

qx.Proto.main = function(){
        var btOpen=new qx.ui.form.Button("OPEN WINDOW")
        btOpen.addToDocument();
        btOpen.addEventListener("execute",this.Test,this);
};

qx.Proto.Test = function(){
        var myWindow=new qx.ui.window.Window();
        myWindow.setCaption("TEST DISPOSE WINDOW");
        myWindow.setBackgroundColor("#b7e54a");
        myWindow.setSpace(100,200,100,200);
        myWindow.set({modal:true, showMaximize:false, showMinimize:false,
showClose:true, resizeable:false, allowClose:true, allowMaximize:false,
allowMinimize:false });
        var myLabel=new qx.ui.basic.Label("a label...")
        myWindow.add(myLabel);
        var btClose=new qx.ui.form.Button("CLOSE WINDOW");
        btClose.addEventListener("execute",function(){
                myWindow.close();
        });
        myWindow.add(btClose);
        myWindow.addToDocument();
        myWindow.open();
        myWindow.addEventListener("appear",function(){
                myWindow.debug("center...");
                myWindow.centerToBrowser();
        });
        myWindow.addEventListener("disappear",function(){
                myWindow.debug("dispose...");
                myWindow.dispose();
        });
};


-- 
View this message in context: 
http://www.nabble.com/When-How-dispose-object---tf2653619.html#a7404310
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to