MainSettings.hs 631 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
module RMCA.GUI.MainSettings where

import Data.ReactiveValue
import Graphics.UI.Gtk
import Graphics.UI.Gtk.Reactive

globalSettings :: IO (VBox, ReactiveFieldReadWrite IO Int)
globalSettings = do
  globalSettingsBox <- vBoxNew False 10
  tempoAdj <- adjustmentNew 120 40 200 1 1 1
  tempoLabel <- labelNew (Just "Tempo")
Guerric Chupin's avatar
Guerric Chupin committed
12
  boxPackStart globalSettingsBox tempoLabel PackGrow 0
13
  tempoScale <- hScaleNew tempoAdj
Guerric Chupin's avatar
Guerric Chupin committed
14
  boxPackStart globalSettingsBox tempoScale PackGrow 0
15 16 17 18 19
  scaleSetDigits tempoScale 0
  let tempoRV =
        bijection (floor, fromIntegral) `liftRW` scaleValueReactive tempoScale

  return (globalSettingsBox, tempoRV)