Dialog tries to be a high-level language that hides Z-machine implementation details from authors. So when an author wants a status bar, they supply a block of (compile-time constant) CSS, and the compiler translates that into Z-machine instructions behind the scenes.
This gets messy, though, when the size of the status bar is not known at compile time. Right now, there’s a hacky way that authors can force the status bar to specific proportions. But it would be much more elegant if the compiler could accept height: auto; and make the status bar expand as needed to fit its contents.
The question is…is this legal on Z-machine? Can I reliably expand the upper window while it already has text in it without wrecking that existing text? (The spec “suggests that it should work as usual” to adjust the status bar height while currently printing to it, but a suggestion is not a rule.)
In particular, does this sample code work on all common interpreters? So far it seems to work fine in Gargoyle and Ncurses Frotz, the two that I have readily on hand.
Z-code file: statustest.z5 (1.5 KB)
Inform source:
[ Main;
print "Main window one.^";
@split_window 1; ! Make a one-line status bar
@set_window 1;
@set_cursor 1 1;
print "First line.";
@split_window 2; ! Two lines?
@set_cursor 2 1;
print "Second line.";
@split_window 3; ! Three lines??
@set_cursor 3 1;
print "Third line.";
@set_window 0;
print "Main window two.^";
];
Ideally this should create a three-line status bar that says “First line. / Second line. / Third line.” What happens to the main-window text underneath varies by implementation and doesn’t really matter.





