From: Alex Fenton Date: 2009-11-10T22:10:11+09:00 Subject: Re: wxRuby + rcairo ... are driving me mad. Philipp Hofmann wrote: > How is it possible to use Wx::GraphicsContext#get_native_context with > rcairo? Let me quote the wxRuby documentation from > > http://wxruby.rubyforge.org/doc/graphicscontext.html#GraphicsContext_getnativecontext > > "Returns the native context (CGContextRef for Core Graphics, Graphics > pointer for GDIPlus and cairo_t pointer for cairo)." [1] > > Is there a way to cast the data the cairo_t pointer points to into a > Cairo::Context? Everything I tried resulted in an 'called on > terminated object' error. Well, at least the reasonable attempts. I suggest you post this on the wxRuby list. I don't know of anyone who's tried to do this. If it doesn't work at the moment, it should be pretty easy to get a Integer corresponding to a C pointer out of the wrapper. But we'd need to know a bit more about what the Cairo wrapping expects. a