Article View: comp.sys.mac
Article #23082LSC beginner (HELP!)
From: Jerry Lieberthal
Date: Tue, 22 Dec 1987 07:29
Date: Tue, 22 Dec 1987 07:29
45 lines
1678 bytes
1678 bytes
I just received my copy of LSC, version 2.13, and the requisite copies of
Inside Mac, plus the intro text USING THE MAC TOOLBOX WITH C. Tried my first
program, and natch, it didn't work. The problem seems to be the way I have
my window defined... I've stared and stared at the code, but I can't seem to
find the problem (it's probably very simple). The code (most of it taken from
the TOOLBOX example):
WindowRecord myWindowRec ;
WindowPtr myWindow, whichwindow ;
Rect bounds ;
char title ;
EventRecord event ;
short where ;
InitGraf (&thePort) ;
InitWindows () ;
InitFonts () ;
InitMenus () ;
FlushEvents (everyEvent, 0) ;
SetRect (&bounds, 50, 50, 400, 200) ; /* is this off the screen, really?*/
title = "untitled" ;
myWindow = NewWindow (&myWIndowRec, &bounds, CtoPstr (title), TRUE, 0,
(WindowPtr) - 1, TRUE, 0) ;
SetPort (myWindow) ; /* not sure this is necessary */
DrawGrowIcon (myWindow) ;
InitCursor () ;
while (TRUE) {
if (GetNExtEvent (everyEvent, &event))
switch (event.what) {
case keyDown: ...
case mouseDown:
... more stuff related to other cases ...
I don't seem to ever be able to click in the window contents, title bar, etc.
Even though I can see the window, it doesn't seem to be active...
What gives????
- jerry@csd4.milw.wisc.edu ihnp4!uwmcsd4!jerry
Technical Details
Message-ID:
<763@uwm-cs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!uwm-cs!jerryShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!uwm-cs!jerry From: jerry@uwm-cs.UUCP (Jerry Lieberthal) Newsgroups: comp.sys.mac Subject: LSC beginner (HELP!) Message-ID: <763@uwm-cs.UUCP> Date: 22 Dec 87 07:29:02 GMT Organization: U of Wi-Milw, College of Engineering Lines: 45 Keywords: beginner C