module GUI.Gtk.Structures
( Send
, Receive
, SendReceive
, Widget (..)
, ListLayout (..)
, Color (..)
) where
import Graphics.UI.Gtk.Gdk.GC (Color (Color))
import Control.Monad.Register (Command (..))
type Send n m a = (a -> n ()) -> m ()
type Receive n m a = ((a -> n ()) -> n (Command -> n ())) -> m (Command -> n ())
type SendReceive n m a = (Send n m a, Receive n m a)
data Widget n m
= Label (Send n m String)
| Button { label_ :: Send n m String
, sensitive_ :: Send n m Bool
, color_ :: Send n m Color
, action_ :: Receive n m ()
}
| Checkbox (SendReceive n m Bool)
| Combobox [String] (SendReceive n m Int)
| Entry (SendReceive n m String)
| List ListLayout [Widget n m]
| Notebook' (Receive n m Int) [(String, Widget n m)]
| forall b . Eq b => Cell ((b -> m (m ())) -> m ()) (forall a . (Widget n m -> m a) -> b -> m (m a))
| Action (m (Widget n m))
data ListLayout
= Horizontal | Vertical