Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!cs.wvu.wvnet.edu!cerc.wvu.wvnet.edu!babcock.cerc.wvu.wvnet.edu From: vrm@babcock.cerc.wvu.wvnet.edu (Vasile R. Montan) Newsgroups: comp.sys.mac.programmer Subject: Re: Drawing windows Message-ID: <1791@babcock.cerc.wvu.wvnet.edu> Date: 24 May 91 02:50:44 GMT References: <21620@brahms.udel.edu> Sender: news@cerc.wvu.wvnet.edu Distribution: usa Lines: 55 From article <21620@brahms.udel.edu>, by stas@brahms.udel.edu (Stanislaus Pietrucha): > 1. Which volume(s) should I get first, with basic information in them. Info > I'll need to write a Mac application with Mac-type interface? In spite of what many people say, I *don't* recommend IM as a set of books for learning how to program the Mac. This is not to say that they are not worthy publications; they are indeed remarkable for their thoroughness. Unfortunately, this same thoroughness necessarily comes at the expense of clarity. I recommend starting with a more introductory book; once you master the basics and want to move into more esoteric techniques, then IM is just the thing. My preference is Macintosh Revealed by Stephen Chernicoff. Volumes I and II are essential; volumes II and IV are nice but not necessary. Each is around $26. These books will cover 80% of all the things you will ever need to do. In understand there is also another good introductory text, whose name escapes me, although it might be 'MacPrimer.' If you want the ISBN numbers for the Chernicoff books, email me at un020070@vaxa.wvnet.edu > 2. How can I create a window on the screen. Basically I ask because when > I run an application created with Think C I get this stupid window that > says "console" and I want to open my own window(s) within the application. There's two basic ways. The first way is to totally create the window from scratch within your program. The second way is to load in the window as a resource. The second way is far more common, and in many ways is both easier and more flexible. To do this second way, do the following: 1. Create a resource file using Reit and associate it with your program, however you do that in Think C. In this resource file, create a WIND resource to represent the window you want. (If this makes no sense whatsoever, email me.) In the following code, I'll assume that this WIND has an ID of 1000. 2. In your program, declare a variable of type WindowPtr, however you do that in C. (I don't know C, so I can't say.) 3. Get the window using the following line: MyWindowPtr := GetNewWindow (1000, nil, nil); Of course, you'll have to figure out how to say this in C. MyWindowPtr is the WindowPtr variable you declared; 1000 is the resource ID of the WIND. 4. To draw in the window, set the current drawing port to this window by saying: SetPort(MyWindowPtr); Good luck! --Kurisuto un020070@vaxa.wvnet.edu