[reactive] Re: GTK + Reactive

Conal Elliott conal at conal.net
Wed Nov 26 16:59:56 EST 2008


I'm glad you got it sorted out.  Thanks for sharing the answer with us.
We'll get a rationale & useful set of tools together, sooner or later.

  - Conal

2008/11/26 Levi Stephen <levi.stephen at gmail.com>

>
> Hi,
>
> This is no longer a problem I managed to get this working by adding the
> following lines:
>
> updater <- mkUpdater (cGetTime clock) (return () `stepper` quitOnDestory
> windowDestroy)
>
> idleAdd (updater >> return True)
>
> Levi
>
>
> On Mon, Nov 24, 2008 at 10:30 PM, Levi Stephen <levi.stephen at gmail.com>wrote:
>
>> Hi,
>>
>> I'm trying to set up a simple program combining Reactive and GTK. I have
>> the program below so far, but mainQuit is never called. After looking at a
>> couple of adapters I tried adding the commented out line, but this didn't
>> work for me.
>>
>> I'm sure I've probably missed something, but I'm not sure what.
>>
>> Thanks,
>> Levi
>>
>> main = do
>>  initGUI
>>
>>  clock <- makeClock
>>
>>  (windowDestroy, sink) <- makeEvent clock
>>
>>  w <- windowNew
>>  w `onDestroy` sink ()
>>  widgetShowAll w
>>
>>  -- forkE (tSync clock) $ quitOnDestroy windowDestroy
>
>
>>
>>  mainGUI
>>
>> quitOnDestroy :: Event () -> Event (IO ())
>> quitOnDestroy e = fmap (const mainQuit) e
>>
>> tSync :: Clock TimeT-> ITime -> IO ()
>> tSync clock t = sleepPast (cGetTime clock) (exact t)
>>
>>
>
>
> _______________________________________________
> Reactive mailing list
> Reactive at haskell.org
> http://www.haskell.org/mailman/listinfo/reactive
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/reactive/attachments/20081126/22466fd7/attachment.htm


More information about the Reactive mailing list