MojoX -> RequestInt -> Can't suspend main fiber

About Monkey 2 Forums Monkey 2 Programming Help MojoX -> RequestInt -> Can't suspend main fiber

This topic contains 3 replies, has 3 voices, and was last updated by  Ratchet 2 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6118

    Ratchet
    Participant

    Every time I try to call RequestInt the program stops and the outputs says

    Can’t suspend main fiber

    What am I doing wrong?

    #6119

    codifies
    Participant

    Its fairly common in a number of GUI’s that you can’t actually call anything creating a UI item from within an event, try just setting a flag in the event and responding to the flag in your main loop…

    #6120

    Mark Sibly
    Keymaster

    You currently need to create a ‘fiber’ inside event handlers if you are writing blocking code, as event handlers run on the main thread and you can’t block the main thread or the entire app will halt.

    In this case, something like this should work:

    #6135

    Ratchet
    Participant

    Great, thanks a lot!
    By the way: Monkey2 rocks 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.