Glulx Status Window Control

version 1/100630 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Phrases to open and close the status-window

    To initialize/initialise the/-- status window:
        (- InitStatusWindow(); -)

    To decide if the/-- status window is already/-- open:
        (- gg_statuswin -)

    To close the/-- status window:
        (- if (gg_statuswin) glk_window_close(gg_statuswin, 0); gg_statuswin = 0; -)

    To reconstruct the/-- status window:
        close the status window;
        open the status window;

    To update the/-- status line:
        (- if (gg_statuswin) DrawStatusLine(); -)

    To open the/-- status window:
        if the status window is already open, rule fails;
        initialize the status window;

    Include
    (-

    [ InitStatusWindow sty;
    if (gg_statuswin == 0) {
        statuswin_cursize = statuswin_size;
        if ( (+ status window background reversed +) ) {
            for (sty=0: sty<style_NUMSTYLES: sty++)
                glk_stylehint_set(wintype_TextGrid, sty, stylehint_ReverseColor, 1);
        }
        gg_statuswin =
            glk_window_open(gg_mainwin, statuswin_pos, statuswin_cursize, wintype_TextGrid, GG_STATUSWIN_ROCK);
    }
    ];
    -)