   cairo_image_surface_create_for_data ;
 
 
-TUPLE: cairo-gadget image-array cairo-t ;
+TUPLE: cairo-gadget < gadget image-array cairo-t ;
 
 M: cairo-gadget draw-gadget* ( gadget -- )
     0 0 glRasterPos2i
     1.0 -1.0 glPixelZoom
     >r 384 256 GL_RGBA GL_UNSIGNED_BYTE r>
-    cairo-gadget-image-array glDrawPixels ;
+    image-array>> glDrawPixels ;
 
 : create-surface ( gadget -- cairo_surface_t )
-    make-image-array
-    [ swap set-cairo-gadget-image-array ] keep
+    make-image-array [ swap (>>image-array) ] keep
     convert-array-to-surface ;
 
 : init-cairo ( gadget -- cairo_t )



USING: cairo.ffi math math.constants byte-arrays kernel ui ui.render
           ui.gadgets opengl.gl ;

IN: cairo-demo


M: cairo-gadget pref-dim* drop { 384 256 0 } ;

: draw-hello-world ( gadget -- )
  cairo-t>>
  dup "Sans" CAIRO_FONT_SLANT_NORMAL CAIRO_FONT_WEIGHT_BOLD cairo_select_font_face
  dup 90.0 cairo_set_font_size
  dup 10.0 135.0 cairo_move_to
