mvz/ruby-gir-ffi — Issue #22: I cannot get drawable for cairo_create
Author: jinto
Created: 2012-01-27 20:05:21+00:00
State: open

I cannot get drawable for cairo_create.

```ruby
require 'rubygems'
require 'cairo'
require 'ffi-gtk3'

GirFFI.setup :WebKit, '3.0'

Gtk.init
win = Gtk::OffscreenWindow.new
view = Gtk::Button.new_with_label("Hello World")
win.set_default_size(800, 640)
win.add view
view.show_all
win.show_all
dst = Cairo::ImageSurface.new(Cairo::FORMAT_ARGB32, 800, 640)
ctx = Cairo::Context.new(dst)
surface = Gdk.cairo_create(win.get_window()).get_target() # here
ctx.set_source_surface(surface)
ctx.paint()
dst.write_to_png('xx.png')
```

Errmr messages are :

(eval):4:in `cairo_create': undefined method `wrap' for Cairo::Context:Class (NoMethodError)
from /var/lib/gems/1.9.1/gems/gir_ffi-0.2.3/lib/gir_ffi/module_base.rb:6:in `method_missing'
from tt.rb:17:in `

'```