2013年1月23日水曜日

HaskellとGTKでHello World

helloworld.hs
import Graphics.UI.Gtk

main = do
    initGUI
    window <- windowNew
    button <- buttonNew
    set window [ containerBorderWidth := 10, containerChild := button ]
    set button [ buttonLabel := "Hello World" ]
    onClicked button (putStrLn "Hello World")
    onDestroy window mainQuit
    widgetShowAll window
    mainGUI
Compile時は
ghc --make -optl-mwindows helloworld.hs 

0 件のコメント:

コメントを投稿