Flexible Windows

version 13/130803 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter 7 - Glk event handling phrases

    [Added by Erik Temple 22 May 2010]

    [These phrases only work within the Glk event-handling rulebooks defined in the Glulx Entry Points extension. These are:

    The glulx line input rules command line input
    The glulx character input rules keystroke input
    The glulx hyperlink rules text hyperlink
    The glulx mouse input rules mouse input in a graphics window
    The glulx redrawing rules graphic window needs redrawing
    The glulx arranging rules windows may need redrawing
    The glulx sound notification rules sound has finished playing
    The glulx timed activity rules timer event
    ]

    [The following phrase will only work within the rules defined in the Glulx Entry Points extension. Specifically, it will only work with the following rulebooks:
        
    The glulx redrawing rules
    The glulx arranging rules
    The glulx mouse input rules
    The glulx character input rules
    The glulx line input rules
    The glulx hyperlink rules

    The phrase will return 0 for the timed activity and sound notification rules, which are not associated with any window.

    The phrase can be used with Flexible Windows like so:
        
        if the ref-number of the current window is the reference of the window in which the event was requested:
            ...do something with this information...
    ]

    To decide which number is the reference of the/-- window in/of/-- which/-- the/-- event was/-- requested/occurred/--:
        (- (gg_event-->1) -)
        
    [The following phrase can only be used within the glulx hyperlink rulebook.]

    To decide which number is the link/-- number of the/-- selected/clicked hyperlink:
        (- (gg_event-->2) -)