Commit 015640da authored by Marc Coiffier's avatar Marc Coiffier
Browse files

Use the safer Foreign.Concurrent.ForeignPtr with the GTK bindings in definitive-graphics

parent cf2e953c
...@@ -22,7 +22,8 @@ module Graphics.Widget.Traits( ...@@ -22,7 +22,8 @@ module Graphics.Widget.Traits(
import Definitive import Definitive
import Foreign.Ptr import Foreign.Ptr
import Foreign.ForeignPtr import Foreign.ForeignPtr hiding (newForeignPtr)
import Foreign.Concurrent
import IO.Time (Seconds) import IO.Time (Seconds)
import Graphics.GDK.KeyCodes import Graphics.GDK.KeyCodes
import IO.Dynamic import IO.Dynamic
...@@ -38,8 +39,7 @@ data WProps a = WProps { ...@@ -38,8 +39,7 @@ data WProps a = WProps {
_wPropsValue :: a _wPropsValue :: a
} }
nullWidgetPtr = thunk $^ do nullWidgetPtr = thunk $^ do
cb <- callback_p_ (const unit) newForeignPtr nullPtr unit
newForeignPtr cb nullPtr
instance Functor WProps where map f (WProps h a) = WProps h (f a) instance Functor WProps where map f (WProps h a) = WProps h (f a)
instance Unit WProps where pure x = WProps nullWidgetPtr x instance Unit WProps where pure x = WProps nullWidgetPtr x
instance SemiApplicative WProps where WProps h f <*> WProps h' x = WProps (max h h') (f x) instance SemiApplicative WProps where WProps h f <*> WProps h' x = WProps (max h h') (f x)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment