使用Haskell Graphics.Gloss时出现GLUT致命错误

时间:2017-07-19 18:03:22

标签: multithreading haskell graphics thread-safety glut

我正在关注 this tutorial 并创建了一个demo.hs文件,其中包含以下内容:

import Graphics.Gloss

window :: Display
window = InWindow "Nice Window" (200, 200) (10, 10)

background :: Color
background = white

drawing :: Picture
drawing = circle 80

main :: IO ()
main = display window background drawing

但是,当我在终端中执行runhaskell demo.hs时,收到以下错误消息:

GLUT Fatal Error: internal error: NSInternalInconsistencyException, reason: nextEventMatchingMask should only be called from the Main Thread!

此错误意味着什么,我该如何解决?我使用的是macOS Sierra版本10.12.5。

0 个答案:

没有答案