Flexible Windows

version 13/130803 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Assigning properties to g-windows

    A g-window has a g-window-position called position.
    A g-window has a g-window-kind called type.
    A g-window has a g-window-type called scale method.
    A g-window has a number called measurement.
    A g-window has a number called minimum size.

    A g-window has a g-window called direct parent. The direct parent is usually the main-window.

    The minimum size of a g-window is usually 0.
    The measurement of a g-window is usually 40.

    A g-window has a number called rock-value. The rock-value is usually 0.
    A g-window has a number called ref-number. The ref-number is usually 0.
    Rock-value property translates into I6 as "rock_value".
    Ref-number property translates into I6 as "ref_number".

    direct parent property translates into I6 as "direct_parent".

    A graphics g-window is a kind of g-window. The type of a graphics g-window is g-graphics.
    A text-buffer g-window is a kind of g-window. The type of a text-buffer g-window is g-text-buffer.
    A text-grid g-window is a kind of g-window. The type of a text-grid g-window is g-text-grid.

    The window-drawing rules are an object-based rulebook.


    When play begins (this is the allocate rocks rule):
        let cnt be 200;
        repeat with item running through g-windows:
            if the rock-value of item is 0:
                set item rock to cnt;
                increase cnt by 10;
            now the direct parent of item is the direct-parent of item;
        set main-window ref.

    To set main-window ref:
    (- MainWinRef(); -).

    Include
    (-
    [ MainWinRef;
    (+main-window+).rock_value = GG_MAINWIN_ROCK;
    (+main-window+).ref_number = gg_mainwin;
    give (+main-window+) g_present;
    ];
    -).

    To set (g - a g-window) rock to (n - a number):
    (- {g}.rock_value = {n};
    -)