Glimmr Canvas Editor

version 1/100805 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Suspending normal input during drawing

    To suspend line input:
        now suspension flag is true;
        cancel line input in main window;
        suspend.
        
    To return to normal input:
        now suspension flag is false.
        
    To suspend:
        (- EscKeypress(); -)
        
    Include (-

    Global suspend_flag = 0;
    Global manual_cancel = 0;

    -) before "Glulx.i6t".


    The suspension flag is a truth state variable. The suspension flag variable translates into I6 as "suspend_flag". The suspension flag is false.

    Include (-

    [ EscKeypress key ix;
        while (suspend_flag) {
            glk_request_char_event(gg_mainwin);
            glk_select(gg_event);
            ix = HandleGlkEvent(gg_event, 1, gg_arguments);
            if (ix >= 0 && gg_event-->0 == 2) {
                key = gg_event-->2;
                if (key == $fffffff8) {
                    suspend_flag = 0;
                    say__p=1;ParaContent(); print "[Element drawing canceled]"; ParaContent(); DivideParagraphPoint(); new_line;
                    FollowRulebook( (+ cancelling drawing rules +) );
                }
            }
        }
        glk_cancel_char_event(gg_mainwin);
    ];

    -)