[cairo] how to interface with an NSWindow
Travis Griggs
tgriggs at cincom.com
Thu Feb 22 00:14:56 PST 2007
I'm working on my VisualWorks Smalltalk interface to Cairo. In that
environment, I have easy access to any NSWindow I open, and the
ability to send objective-c messages. So what I do is basically:
1) fetch the class named NSGraphicsContext
2) id nsGC = [NSGraphicsContext graphicsContextWithWindow: myNSWindow];
3) cgCtx = [nsGC graphicPort];
4) cairo_nquartz_surface_create_for_cg_context (cgCtx, 200, 200, 1);
But when I do drawing ops on that surface, nothing happens. :( Am I
doing this right at all? Or is there a better/different way to do it?
Do I need to send additional messages to the NSGraphicsContext or to
the CGGraphicsContext (this is just a struct pointer,right?)?
I'm using 1.2.6 (I think). I'm confused about the recent sent of
messages regarding osx apis and stability thereof. Should I upgrade
to the new snapshots for cairo?
TIA
--
Travis Griggs
Objologist
My Other Machine runs OSX. But then... so does this one.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/cairo/attachments/20070222/70859908/attachment.html
More information about the cairo
mailing list