Login
Remember
IF Answers
Ask a Question

# How do you avoid an extra line break when refreshing a window with Flexible Windows (Inform 7)?

0 votes
94 views
asked May 28 in Authoring by bg (692 points)

This

    Include Flexible Windows by Jon Ingold.

    The sidebar is a g-window.
    The main window spawns the sidebar.
    The scale method of the sidebar is g-fixed-size.
    The measurement of the sidebar is 40.
    The position of the sidebar is g-placeleft.

    Every turn while the sidebar is g-present:
        Refresh the sidebar.

works fine. But adding this

    Rule for refreshing the sidebar:
        say "Text."

Adds an extra line break in the main window every turn.

How can I avoid this? It reminds me of this rulebook break issue but I'm not sure if it's related.

- inform7
- flexible-windows
- glulx

commented May 28 by Dannii (329 points)
Looks like the same problem which was reported here http://www.intfiction.org/forum/viewtopic.php?f=7&t=17425#p87342 - which I still have to fix. I'll try to fix it ASAP.
commented Jun 13 by bg (692 points)
reshown Jun 19 by bg
This seems relevant--a note from Erik Temple's Input-Output Control:
"Section: A caveat
Inform's complex paragraph printing and line breaking algorithms (see http://inform7.com/sources/src/i6template/Woven/B-print.pdf ) were not designed with multiple windows in mind, and not everything works perfectly when we use them. Most notably, switching output streams can cause line break issues, as Inform's paragraphing functions are not aware of the change in window streams. In writing this extension, I have tried to provide as little as possible in the way of customized spacing behavior, since I expect the extension will have many potential uses. In most cases customizing display issues won't be too onerous a task (not any more onerous than dealing with line-spacing in general, anyway), but be prepared to need to customize a few things. The examples, particularly "On the Edge", give some idea of the kinds of tweaks that may be necessary."
https://github.com/i7/extensions/blob/master/Erik%20Temple/Text%20Window%20Input-Output%20Control.i7x
So I'm guessing it's just a case of Inform wanting to leave its usual paragraph break after printing text, but switching back to the main window before printing the paragraph break. I put "run paragraph on" after refreshing the sidebar and so far it seems to take care of the problem, though I haven't tested it extensively.
commented Jun 19 by bg (692 points)
I just ran into a case that broke my little "run paragraph on" fix: a room without a description. In that case, my fix will result in a missing line break were there should be one.
commented Jun 19 by bg (692 points)
Also, there's still an extra line break when you first arrive in another room.

##

## Related questions

- With Flexible Windows, can you specify whether a window will have a scroll bar? (Inform 7)
- How do you test whether the player's interpreter will support windows created with Flexible Windows? (Inform 7)
- How do you use a hyperlink to paste text without (in effect) pressing enter? (Flexible Windows, Inform 7)
- With Flexible Windows by Jon Ingold, is there a way to make the text display at the top of the window, even in Gargoyle? (Inform 7)
- How do you indent text in a window using Flexible Windows by Jon Ingold? (Inform 7)

...