split GUI into several modules
[hs-pgms.git] / src / GUI / Common.hs
blob337268603d38030c9d17ebed2d1f0183eced6ff0
1 module GUI.Common (
2 Globals (..),
3 State (..),
4 initState,
5 maxSize,
6 ) where
8 import Mine
10 import qualified Graphics.UI.Gtk as G
11 import Data.IORef
13 maxSize :: Pos
14 maxSize = Pos 30 16
16 data Globals = Globals {
17 gBoard :: G.DrawingArea,
18 gStatusbar :: G.Statusbar,
19 gState :: IORef State
22 data State = State {
23 sConfig :: Config,
24 sStrategy :: Strategy,
25 sBoard :: Maybe Board,
26 sStop :: Maybe (IO ()),
27 sPreviousConfigItem :: Maybe G.RadioMenuItem
30 initState strats = State {
31 sConfig = beginner,
32 sStrategy = head strats,
33 sBoard = Nothing,
34 sStop = Nothing,
35 sPreviousConfigItem = Nothing