1
我正在使用wxHaskell在窗口中显示完整图像。我的代码是:用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 []
无论如何,当应用程序运行什么都没有显示(甚至没有窗口的边界)。我怎样才能使它工作?