How to use Flexible Windows by Jon Ingold?

Hey Everyone

Could anyone give me a working example of how to use the extension “Flexible Windows” by Jon Ingold?
The given examples don’t compile and i have no clue how to use the updatede code.

I got the extension from here:
github.com/i7/extensions/blob/m … indows.i7x

Thanks! :slight_smile:

The example that won’t compile is this one:

"Inventory Window"

    The Study is a room. In the study is an old oak desk. On the desk is a Parker pen, a letter, an envelope and twenty dollars.

    Include Flexible Windows by Jon Ingold.

    The side-window is a text-buffer g-window spawned by the main-window.

The default setting for position - on the right - will do here, but the window could be smaller.

    The measurement of the side-window is 30.

    Window-drawing rule for the side-window (this is the construct inventory rule):
        move focus to side-window, clearing the window;
        try taking inventory;
        return to main screen.

Finally, two rules: one to make the window appear, and the other to keep it up-to-date.

    When play begins:
    open up the side-window.

    Every turn when the side-window is g-present: follow the window-drawing rules for the side-window.

    Test me with "take pen/take letter/i/take all".

So it looks like you copy-pasted straight from the documentation, which means the comments (like “The default setting for position…”) were included, and all the code is one tab in. There should be a blue square next to the title; clicking that will paste the code itself at the current position of the mouse pointer without including the comments.

Sorry, i actually did remove the comments. What i meant was that was the example given to you on the page of Flexible Windows.
The actual code i tried to compile was this:

The side-window is a text-buffer g-window spawned by the main-window.

The measurement of the side-window is 30.

Window-drawing rule for the side-window (this is the construct inventory rule):
	move focus to side-window, clearing the window;
	try taking inventory;
	return to main screen.

When play begins:
	open up the side-window.

Every turn when the side-window is g-present: follow the window-drawing rules for the side-window.

and the error you get is this one:

Problem. The sentence 'The side-window is a text-buffer g-window spawned by the main-window'   appears to say two things are the same - I am reading 'side-window' and 'text-buffer g-window spawned by the main-window' as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that 'Tom is Jerry'. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance 'Mouse-Hole is a lighted room' says that something called Mouse-Hole exists and that it is a 'room', which is a kind I know about, combined with a property called 'lighted' which I also know about.

i generally don’t understand the error “saying two things are the same thing” exactly why aren’t you allowed to do that?

Check your spelling. The error message you pasted is complaining about a “g-text-buffer window”, which is what’s confusing it; the name of the kind is “text buffer g-window”. Inform is sometimes forgiving about word-reordering, but not here. Therefore, Inform thinks you just created two arbitrary objects called “the side-window” and “a g-text-buffer window spawned by the main window”, neither of them having anything to do with the window system; and you are trying to say they’re actually the same thing, which is nonsensical.

im sorry again, i copy-pasted some code that i had been messing around with, i edited with the original now. I am getting the exact same error though.

The examples you have must be old because the extension doesn’t have any up to date ones yet.

These questions will help: ifanswers.com/tag/flexible-windows

ifanswers.com domain is now gone!

Bumping this thread as another appeal for modern, working, Inform 7 examples of Flexible Windows. I did figure out the new domain name for ifanswers: docs.textadventures.co.uk/ifansw … le-windows

allensocket, what version of Flexible Windows are you using? (It’s been updated since this thread began.)

If the example in the documentation isn’t working, what is the exact error message you are getting?

I am using the latest off Github. I finally got this ‘inventory side window’ working, and posted code on a different topic: Creating an inventory window - #4 by allensocket

As a request, what I think the community really needs is a complex example. The opening of “Dead Cities” ifdb.tads.org/viewgame?id=q5el4dphbf7q6e5y is really the kind of sample I wish was maintained with source code that compiles on latest Inform 7. It has 4 windows: One upper right with graphic image, one bottom right with Inventory, one on the bottom with helps and tips (including hyperlinks), and finally the main window.

I haven’t found any source code that compiles that demonstrates this kind of complexity. My research keeps landing on these very simple example topics.

Kerkerkruip has 20 something windows. The main window doesn’t work perfectly, but the windows inside the game itself do.

Thank you for the reminder, I looked at that a couple months ago and today I took a fresh look. I took that code and hacked out all of the “game story” that I could so I could just get the essential Flexible Windows logic. Here is a branch on Github of what I could get working as a ‘minimal’ set of logic to start the basic structure of the Windows in Kerkerkruip . github.com/BroadcastGames/kerke … owExample0

Thanks again for this. It is a good test of my logic using RemGlk’s output data and Kerkerkruip’s window layout. i was able to get the window layouts to render correctly on native Android. Consider it a public request observation that Flexible Windows by Jon Ingold only works on Glulx and not Z-machine - can’t that be done?

The Z-Machine (excluding version 6, which is not supported by Inform/Parchment/Gargoyle/etc) is not flexible. You get the main window and the status window, and that’s it. Basic Screen Effects gives some tools for doing more complex status windows.

Well, that probably explains why almost all the Android apps didn’t support Glulx interpreters and why I ended up abandoning each of their “partial” Glk implementations - because running Glulx that means encountering story data files with complex Glk windows. I’ve made great progress on that issue of multiple windows and should have a new app out by New Years.