So I'm trying to create a nifty dialog in SlickC.
I noticed some interesting code in "CheckboxTree.e", but I don't understand how it works.
When I try something similar, I get Slick to lock up, apparently due to a recursive object construction.
The real question I guess is class object instances / lifetimes.
From the meager documentation, there is no "new" or "delete", so there is no direct way to create heap instances of a class. If you have an instance as a local, it dies when the function dies.
So, what does this code in CheckboxTree.e mean?
public CheckboxTree(int wid = 0) { m_treeHandle = wid; // this needs to be the last thing done in the constructor, so we always have // up to date data tieCheckboxToTree(wid);
}
[/color]protectedvoid tieCheckboxToTree(int wid) { _SetDialogInfoHt(CHECKBOXTREE, this, m_treeHandle, true); }
[/color]When I try something similar in my code, I get infinite recursion because the call to "_SetDialogInfoHt" constructs a copy of my object.
[/color]Given the lack of new/delete, I guess this should be what I'd expect, but then that doesn't explain what CheckboxTree is trying to do here, and how it is avoiding my terrible fate.