[cairo] Cairo and FLTK?

Bill Spitzak spitzak at thefoundry.co.uk
Tue Oct 30 03:26:23 PDT 2007


The correct xid is available in static variables, this should make it a 
lot easier. Inside a draw() method this should work in fltk1 for both 
single and double-buffered windows.

cairo_surface_t* surface =
   cairo_xlib_surface_create(fl_display, fl_window, fl_visual->visual,
	this->w(), this->h());

// you probably should destroy the surface when done drawing. If you
// keep it around you must track any resizes or any reason fltk decides
// to close the window. This is possible by overriding resize() and
// destroy().


-- 
Bill Spitzak, Senior Software Engineer
The Foundry, 1 Wardour Street, London, W1D 6PA, UK
Tel: +44 (0)20 7434 0449 * Fax: +44 (0)20 7434 1550 * Web: 
www.thefoundry.co.uk
The Foundry Visionmongers Ltd * Registered in England and Wales No: 4642027



More information about the cairo mailing list