packages feed

lgtk 0.5.2 → 0.5.3

raw patch · 5 files changed

+20/−16 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

lgtk.cabal view
@@ -1,5 +1,5 @@ name:               lgtk-version:            0.5.2+version:            0.5.3 category:           GUI synopsis:           lens-based API for Gtk description:
src/Control/Monad/EffRef.hs view
@@ -7,6 +7,7 @@     , SafeIO (..)     , EffIORef (..)     , putStrLn_+    , forkIOs     ) where  import Control.Concurrent
src/Control/Monad/Register/Basic.hs view
@@ -88,8 +88,8 @@     -> k a evalRegister_ m ch = do     vx <- newRef' $ error "evalRegister"-    (a, (), (reg, _)) <- runRWST m (ch . (>> join (runMorphD vx get))) ()-    runMorphD vx $ put $ runMonadMonoid reg+    (a, (), reg) <- runRWST m (ch . (>> join (runMorphD vx get))) ()+    runMorphD vx $ put $ runMonadMonoid $ fst reg     return a  
src/GUI/Gtk/Structures/IO.hs view
@@ -84,7 +84,8 @@         Entry (r, s) -> do             w <- liftIO' entryNew             hd <- reg s $ \re -> on' w entryActivate $ entryGetText w >>= re-            ger hd r $ entrySetText w+            hd' <- reg s $ \re -> on' w focusOutEvent $ lift $ entryGetText w >>= re >> return False+            ger (\x -> hd x >> hd' x) r $ entrySetText w             return' w         Checkbox (r, s) -> do             w <- liftIO' checkButtonNew@@ -112,7 +113,7 @@             _ <- reg s $ \re -> on' w switchPage $ re             return'' ws w         Cell onCh f -> do-            let b = True --False+            let b = False             w <- liftIO' $ case b of                 True -> fmap castToContainer $ hBoxNew False 1                 False -> fmap castToContainer $ alignmentNew 0 0 1 1
src/LGtk.hs view
@@ -163,19 +163,21 @@ It leaves the event cycle when the window is closed. -} runWidget :: (forall m . EffIORef m => Widget m) -> IO ()-runWidget e = do-    post_ <- newRef' $ return ()-    let post' = runMorphD post_ . modify . flip (>>)-    ch <- newChan+runWidget desc = do+    postActionsRef <- newRef' $ return ()+    let addPostAction  = runMorphD postActionsRef . modify . flip (>>)+        runPostActions = join $ runMorphD postActionsRef $ state $ \m -> (m, return ())+    actionChannel <- newChan     _ <- forkIO $ forever $ do-        join $ readChan ch-        join $ runMorphD post_ $ state $ \m -> (m, return ())-    Gtk.gtkContext $ \post ->-        runExtRef_ $ unliftIO $ \u ->+        join $ readChan actionChannel+        runPostActions+    Gtk.gtkContext $ \postGUISync -> do+        widget <- runExtRef_ $ unliftIO $ \unlift ->             evalRegister-                (        runIdentityT $-                    Gtk.runWidget u post' post e)-                (liftIO . writeChan ch . u)+                (runIdentityT $ Gtk.runWidget unlift addPostAction postGUISync desc)+                (liftIO . writeChan actionChannel . unlift)+        runPostActions+        return widget  -- | Vertical composition of widgets. vcat :: [Widget m] -> Widget m