Error installing gtk3

Francesco Ariis fa-ml at
Sat May 31 06:16:19 UTC 2014

On Mon, May 12, 2014 at 04:36:52PM +0200, Axel Simon wrote:
> Hi Francesco,
> it seems that you're running a different Gtk version than the developers.
> You can safely add a castPtr around the mentioned function calls (toWindow parent) that appear on the lines mentioned in the error message, i.e. Graphics/UI/Gtk/Printing/PrintOperation.chs:409 and others.
> If that works, please submit a patch!
> Regards,
> Axel

Hey Axel,
    thanks for the suggestions; I might need a more guidance. Reading the
code I know that toWindow has type

    toWindow :: WindowClass o => o -> Window

and Window is

    newtype Window = Window (ForeignPtr (Window)) deriving (Eq,Ord)

Finally, castPtr has type

    castPtr :: Ptr a -> Ptr b

Now, ghc complains that it expects |Ptr ()| instead of |Window|; I am
not sure how to pipe the above functions together to obtain this. Searching
Hoogle I found a functions with compatible signatures

    unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a

labelled as "potentially dangerous operation" (and how would I get to
that |ForeignPtr (Window)|? Pattern match?).

In so many words: how to use |castPtr| here?
Thanks in advance

More information about the Libraries mailing list