Text Window Input-Output Control

version 2 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Hacked box quote window routine

    Include (-

    [ Box__Routine maxwid arr ix lines lastnl parwin;
    maxwid = 0; ! squash compiler warning
    lines = arr-->0;

    if (gg_quotewin == 0) {
    gg_arguments-->0 = lines;
    ix = InitGlkWindow(GG_QUOTEWIN_ROCK);
    if (ix == 0)
    gg_quotewin =
    glk_window_open(gg_mainwin, winmethod_Fixed + winmethod_Above,
    lines, wintype_TextBuffer, GG_QUOTEWIN_ROCK);
    } else {
    parwin = glk_window_get_parent(gg_quotewin);
    glk_window_set_arrangement(parwin, $12, lines, 0);
    }

    lastnl = true;
    if (gg_quotewin) {
    glk_window_clear(gg_quotewin);
    glk_set_window(gg_quotewin);
    lastnl = false;
    }

        VM_Style(BLOCKQUOTE_VMSTY);
    for (ix=0 : ix<lines : ix++) {
    print (string) arr-->(ix+1);
    if (ix < lines-1 || lastnl) new_line;
    }
        VM_Style(NORMAL_VMSTY);

    if (gg_quotewin) glk_set_window( (+ current text output window +).ref_number );
    ];

    -) instead of "Quotation Boxes" in "Glulx.i6t"