Loading WindowsLoading windows is more difficult than saving them, primarily because you have to new each window, load it up, and then remember to delete it when it's no longer needed. This function is recursive, and looks like this in PDL:
In other words, you'd load windows from disk exactly as you would expect. First, you take care of the base window: read in its properties. Then, read in the total number of children of the base window. For each child, read an ID byte, new up a window based on that ID, and then tell that new window to load itself (recurse down into it). Once all of your children are loaded, you're done. Of course, it's also very important that your file structure mirrors this same layout. Make sure your save code saves things in the same order that you're loading them.
|
||||||||||||||||||||