keera-hails-mvc-environment-gtk-0.0.3.3: Haskell on Gtk rails - Gtk-based global environment for MVC applications

Safe HaskellNone
LanguageHaskell98

Hails.MVC.GenericCombinedEnvironment

Description

This module contains the necessary functions to manipulate a global environment that gives access to the view and the model in a MVC-structured program with a Gtk View.

It contains the necessary functions to create an environment that holds a View and a Protected Reactive Model.

Although this code is stable, the design is experimental. Usage in real applications should give way to better implementations.

Synopsis

Documentation

data (GtkGUI a, Event c) => CEnv a b c Source

Given a GUI and a Type for the events, a CEnv contains a View and a Protected Model.

createCEnv :: (GtkGUI a, Event c) => b -> IO (CEnv a b c) Source

To create an Environment, we just need to provide the default internal model. The initialisation operations for the view and the protected model are called internally.

installConditions :: (GtkGUI a, Event c) => CEnv a b c -> [CEnv a b c -> IO ()] -> IO () Source

Installs several conditions in the Combined Environment.

FIXME: I really don't like the syntax installConditions cenv [ rv1 =:= rf1 , ... ]

I'd rather use installConditions cenv $ do rv1 =:= rf1 rv2 =:= rf2 ... Which means that I would have to define a monad.

NOTE: This is an experimental function and might be removed in the future.

installCondition :: (GtkGUI a, Event c) => CEnv a b c -> (CEnv a b c -> IO ()) -> IO () Source

Installs a condition in the Combined Environment.

NOTE: This is an experimental function and might be removed in the future.