Am 02.09.2014 um 09:25 schrieb Vivian McPhail:
> I've tried using pointers (Ptr a) but (DC a) and (Gtk.DrawWindow) aren't
> members of `Storable`.
I don't think there is any restriction to the type of the pointer
target. Does GHC expect, that DC is Storable when you use an argument of
type Ptr
Hi,
I've tried using pointers (Ptr a) but (DC a) and (Gtk.DrawWindow) aren't
members of `Storable`.
On Linux WxWidgets is written on top of GTK and I am trying to access an
underlying Gtk.DrawWindow so that I can perform cairo rendering on that
window.
Any ideas?
Vivian
On 31 August 2014 19:3
Am 31.08.2014 um 06:48 schrieb Vivian McPhail:
> foreign import ccall unsafe "plot.cc gdk_get_drawable"
> c_gdkGetDrawable :: DC a -> IO Gtk.DrawWindow
> How do I fix these errors?
You certainly need to use pointers, e.g. Ptr (DC a).
---
Hi,
I defined in "plot.cc":
#include
#include
extern "C" {
GdkWindow* gdk_get_drawable(wxPaintDC* dc)
{
return dc->GetGDKWindow();
}
}
And then in my haskell source Plot.hs:
#else
foreign import ccall unsafe "plot.cc gdk_get_drawable"
c_gdkGetDrawable :: DC a -> IO Gtk.Dra