Allow more than two windows in windowtest
While working on Twisty's Glk implementation I wanted to be able to use windowtest with more than two windows. So I've added optional parameters to open, close and arrange to specify the window / key window to operate on. I've attempted to preserve the existing behaviour and it should be the same when there's two windows except for the error messages. The altwin now refers to the last created window.
To specify a window I'm currently using the opaque window reference that gets printed when you create a window or use the windows command. A downside of this is that for automated test cases those numbers can change between implementations. To avoid that I could assign an auto-incrementing rock to each window and use that as an id instead. What do you think about that?
I haven't yet added window reference parameters to the other commands besides open / close / arrange, but I intend to do so when I get around to testing those parts in Twisty.
This is my first time working in Inform 6, so let me know if I did something horrid :-)
Example of use: open bottom proportional 50 buffer open window=42 top fixed buffer 2 open window=45 right grid proportional 50 close window=45 arrange window=42 keywindow=47 top fixed 2
This is a big change; I want to look it over more carefully before I pull it in. But thank you.
Specifying windows by rock number is probably better. It's okay to say that this test never creates two windows with the same rock number. (Although of course that's legal in general.)
You're welcome. I'm mainly looking for feedback on what would be an acceptable degree of polish. With a tool like this there's a gap between it doing what it needs to and it being user-friendly and robust in all cases. Where do you draw the line?
For example, another improvement point I forgot to mention is that when the close command is used without arguments, it will currently set the altwin / last created window reference to 0 like in the original. So if you have non-pair windows A, B and C, using close once will close C. Using close again will state there is no window to close, while it would make more sense for it to close B since that's the last created window at that point. Likewise, if you close an ancestor of the altwin, the altwin variable doesn't get updated and will result in a glk error if a command attempts to use it.
Another point: when creating new windows, the "This is a new X window, size Y by Z" text in the existing windows doesn't get updated, which looks weird.