Creating an inventory window

I have searched the forum, to no avail. Armed with the current version of Flexible Windows from GitHub, I cannot make an inventory window function.

Rule for refreshing inventory window: try taking inventory;

This just produces the error (in the inventory window): “That isn’t available.”

Flexible Windows doesn’t have any example code that would suggest a method for dealing with this. I can print text to that window, but not the output of actions. What am I doing wrong?

You could do something like this, and not mess with the “taking inventory” action at all:

[code]Include Flexible Windows by Jon Ingold.

MyWindow is a text buffer g-window.
The main window spawns MyWindow.
The position of MyWindow is g-placeabove.

When play begins:
open MyWindow.

Every turn:
refresh MyWindow.

Rule for refreshing MyWindow:
say “[list of things held by the player]”.

Place is a room.

A petri dish is carried by the player.
A flask is carried by the player.
A wallet is carried by the player.[/code]

But you’ll probably have to fiddle with it to get it formatted the way you want.

It’s probably this bug: inform7.com/mantis/view.php?id=1507

Solution: call it the inventory-window instead.

For the sake of sharing, here is sample code that I just tested on Inform 7 build 6M62:

"GlkWindowLearning1" by "Community".

The story genre is "Other". The release number is 1.  [genre: https://intfiction.org/t/defining-the-story-genre/4615/1 ]
The story headline is "Glulx technical demonstration". [ This is all about pure Glulx, not Z-Machine due to extension. ]

Include version 15/161003 of Flexible Windows by Jon Ingold.
[DEPENDENCY: Simple Graphical Window automatically includes Flexible Windows by Jon Ingold]
[Include version 10/161003 of Simple Graphical Window by Emily Short.]

The side-window is a text buffer g-window spawned by the main window.
The measurement of the side-window is 30.
The position of the side-window is g-placeright.

Rule for refreshing the side-window:
	say "[bold type]Side-Window[roman type]";
	try taking inventory;

When play begins:
	open up the side-window.

[If user picks up item, the side window inventory needs refreshed. Brute force approach is to do it every single turn regardless if the user actions altered inventory.]
Every turn:
 	refresh side-window.

Place is a room.  "You can go west. You can try 'drop flask' to see if the Side-Window reflects changes."

Western World is west of Place. "You can go back east."

A petri dish is carried by the player.
A flask is carried by the player.
A wallet is carried by the player.