Flexible Windows

version 13/130803 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Bordered g-windows

    A bordered g-window is a kind of g-window. A bordered g-window has a glulx color value called border-colour.
    A bordered g-window has a number called border-measure. The border-measure of a bordered g-window is usually 3.

    A g-border is a kind of g-window.
    The type of a g-border is always g-graphics. The scale method of a g-border is always g-fixed-size.

    Every bordered g-window spawns four g-borders.

    After constructing a bordered g-window (called the main-panel) (this is the place-borders rule):
        apply borders to main-panel;

    To apply borders to (main-panel - a g-window):
        let border piece be g-placeleft;
        repeat with item running through g-borders spawned by the main-panel
        begin;
            now the back-colour of the item is the border-colour of the main-panel;
            now the measurement of the item is the border-measure of the main-panel;
            now the position of the item is border piece;
            let the border piece be the g-window-position after border piece;
            now the item is g-required;
        end repeat.

    When play begins when the main-window is a bordered g-window:
        apply borders to main-window.