AutoForms-0.4.0: src/Examples/Misc/SettingsForm.hs
{-# LANGUAGE FlexibleContexts, FlexibleInstances
, MultiParamTypeClasses, TemplateHaskell, UndecidableInstances #-}
module SettingsForm where
import Graphics.UI.AF.AFWx
import Graphics.UI.WX
data Settings = Settings { lineWrap :: Bool, splitWords :: Bool
, autoSave :: Bool, tabulatorStops :: [Int]
, spacesInSteadOfTabulators :: Bool } deriving (Show, Eq)
$(derive [''Settings])
defaultValues :: Settings
defaultValues = Settings True False False ([4,8,12] ++ [16,20..120]) False
main = start $
do w <- frame [ text := "Text Editor Settings Forms" ]
p <- panel w []
wid <- makeWidget defaultValues p []
set p [ layout := widget wid ]