Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!gt0t+ From: gt0t+@andrew.cmu.edu (Gregory Ross Thompson) Newsgroups: comp.sys.apple2 Subject: GrafPorts Message-ID: Date: 31 Oct 90 06:21:41 GMT Organization: Carnegie Mellon, Pittsburgh, PA Lines: 37 This is to all you toolbox gurus out there: I'm working on doing some quickdraw stuff from C. I need to a few things with GrafPorts. First, I save the current one so I can re-set it at the end of this whole thing. I do this with: oldport=GetPort(); My guess is that it's working fine. I don't see why not. The problem arises when I need to open my own port. I'd use: Open Port(myportptr); But toolbox 2 is really vague. It says things like: "Normally, you don't call OpenPort yourself--in most cases, your application will draw into a window you've created with Window Manager routines, and these routines call OpenPort to create the window's GrafPort." So the toolbox ref doesn't say much about opening your own grafports. Do I have to allocate some memory and send a handle to quickdraw, or what? Is there any way I can tell it to open up a new GrafPort just like the old one? Should I just do: oldport=GetPort(); {all of my code} SetPort(oldport); to restore the original port? Should I open up a completely new port? I'm so confused... Please respond via mail so as not to clog the net. -Greg T. gt0t+@andrew.cmu.edu