我正在使用 wxHaskell 在窗口中显示完整图像。我的代码是:
import Graphics.UI.WX
import Graphics.UI.WXCore
main :: IO ()
main = start testimg
testimg :: IO ()
testimg = do
f <- frame [text := "Test Image"]
p <- panel f []
image <- bitmapCreateFromFile "landscape.png"
imagep <- panel p [ on paint := onPaint image ]
set f [ layout:= fill $ container p $ widget imagep ]
where
onPaint image dc rect = drawBitmap dc image pointZero True []
无论如何,当应用程序运行时,什么都不会显示(甚至窗口的边框也不显示)。我怎样才能让它工作?