Skip to content

Instantly share code, notes, and snippets.

@ozanmakes
Created January 19, 2015 18:25
Show Gist options
  • Save ozanmakes/17f16ebd78064d2931b9 to your computer and use it in GitHub Desktop.
Save ozanmakes/17f16ebd78064d2931b9 to your computer and use it in GitHub Desktop.
Thrust menu example
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad.IO.Class (liftIO)
import Graphics.UI.Thrust
import Graphics.UI.Thrust.SimpleMenu
import qualified Graphics.UI.Thrust.Window as W
setup :: Window -> UI ()
setup w =
do W.create
buildMenu [Menu "Application"
[Item "About Thrust Haskell" . liftIO $
putStrLn "Thrust Haskell 0.0.1"]
,Menu "Window"
[Item "Maximize" W.maximize
,Item "Minimize" W.minimize
,Item "Restore" W.restore
,Separator
,Item "Resize" $ W.resize 1024 768]]
W.setTitle "Thrust Haskell"
W.show
W.setFocus True
main :: IO ()
main = startGUI defaultConfig setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment