Flexible Windows

version 13/130803 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Hyperlink event handling

    A glulx hyperlink rule (this is the default hyperlink handling rule):
        unless the status window is the hyperlink source:
            now the current hyperlink window is the window with the reference of the window in which the event occurred;
        now the current hyperlink ID is the link number of the selected hyperlink;
        unless the current hyperlink ID is 0:
            cancel glulx hyperlink request in the current hyperlink window;[just to be safe]
            follow the hyperlink processing rules;
        if the status window is the hyperlink source:
            request glulx hyperlink event in status window;
        otherwise:
            request glulx hyperlink event in the current hyperlink window.

    To request glulx hyperlink event in (win - a g-window):
        (- if (glk_gestalt(gestalt_Hyperlinks, 0)) glk_request_hyperlink_event({win}.ref_number); -)

    To cancel glulx hyperlink request in (win - a g-window):
        (- if (glk_gestalt(gestalt_Hyperlinks, 0)) glk_cancel_hyperlink_event({win}.ref_number); -)

    To request glulx hyperlink event in the/-- status window:
        (- if (glk_gestalt(gestalt_Hyperlinks, 0) && gg_statuswin) glk_request_hyperlink_event(gg_statuswin); -)
        
    To cancel glulx hyperlink event in the/-- status window:
        (- if (glk_gestalt(gestalt_Hyperlinks, 0) && gg_statuswin) glk_cancel_hyperlink_event(gg_statuswin); -)

    To decide whether the status window is the hyperlink source:
        (- (gg_event-->1==gg_statuswin) -)

    To decide which g-window is the window with (N - a number):
        repeat with item running through g-windows:
            if N is the ref-number of item:
                decide on item;
        decide on main-window.