frpnow-gtk3-0.2.0: Program GUIs with GTK3 and frpnow!

Copyright(c) George Steel 2017
LicenseBSD3
Maintainergeorge.steel@gmail.org
Safe HaskellNone
LanguageHaskell2010

Control.FRPNow.GTK.Misc

Description

Utility Functions which do not fit anywhere else in the package.

Synopsis

Documentation

mapBAsync :: Eq a => Event () -> b -> (a -> b) -> Behavior a -> Now (Behavior b, Behavior Bool) Source #

Map an expensive computation over a Behavior to WHNF in a background thread (force is useful to get deep evaluation). The output behavior will lag behind the input behavior and thus requires an initial value. To control the running of the computation, this function also takes an event after which all changes are disregarded (can be provided by getUnrealize to tie this ti widget lifetimes) and returns a boolean Behavior which indicated if a new result is currently pending.

beforeE :: Event a -> Event () -> Behavior (Event a) Source #

Filter an event so that it only resolves if it does so before a cutoff event.

setLockedFuturistic :: WidgetClass w => w -> Behavior Bool -> Now () Source #

Disable a widget when the condition is true. Does not check the initial state iof the condition and assumes it to be False initially. This isso it can be used inside mfix where the condition has not been defined yet..

runFileChooserDialog :: FileChooserDialog -> Now (Event (Maybe FilePath)) Source #

Run a FileChooserDialog without blocking and return an Evemnt containing the resulting selected path.

checkIOError :: IO a -> IO (Maybe a) Source #

Check any IOErrors returned by the action so that they result in a Nothing value.

widgetAddClasses :: (MonadIO m, WidgetClass widget) => [Text] -> widget -> m widget Source #

Add CSS classes to a widget.