Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!samsung!uunet!seismo!sundc!newstop!sun!imagen!atari!portal!cup.portal.com!Arthur_P_Bebak From: Arthur_P_Bebak@cup.portal.com Newsgroups: comp.sys.mac.programmer Subject: Listomania!! Message-ID: <26163@cup.portal.com> Date: 21 Jan 90 01:57:27 GMT Distribution: usa Organization: The Portal System (TM) Lines: 84 I am in the midst of an excursion into the uncharted depths of the list manager, and, of course, can't get it to work (please, suppress your gasps of amazement...). I have a simple shell program which opens up a simple window and at the appropriate menu choice executes the following routine (assume the correct .h files): extern WindowRecord window; /* window */ extern WindowPtr myWindow; /* pointer to current window */ ListHandle theList; /* a handle to the list */ list() { Rect rectView,dataBounds; Point cSize; Cell theCell; char string[10]; FontInfo info; /* set up the font and cell size */ TextFont(systemFont); GetFontInfo(&info); cSize.h = 230; cSize.v = info.ascent+info.descent+info.leading; /* set up the view and data bounds rectangles */ SetRect(&rectView, 30,30,260,260); FrameRect(&rectView); SetRect(&dataBounds,0,0,1,0); /* Give my creature LIFE!!! */ theList = LNew(&rectView,&dataBounds,cSize,0,myWindow, TRUE,FALSE,FALSE,TRUE); /* add the string */ SetPt(&theCell,0,0); strcat(string,"Test1"); CtoPstr(string); LAddToCell(string,strlen(string),theCell,theList); /* turn on drawing, probably redundant given my LNew call */ LDoDraw(TRUE,theList); LDraw(theCell,theList); } /* list */ Now, being the gullible person that I am I would imagine that I should get a nice rectangle with an inactive scroll bar on the right, and with "Test1" prominently displayed near its top. But Nooooooooo... all I get is a blank rectangle with the aforementioned inactive scroll bar at the right. So I thinks to myself, thinks I, "Arthur old boy, you've overlooked something obvious, like perhaps LdUpdate". So being in the habit of listening to myself I add the following update procedure to be called during an update event: extern ListHandle theList; /* a handle to the list */ void UserUpdate(wPtr) WindowPtr wPtr; { GrafPtr theCurrentPort; GetPort(&theCurrentPort); SetPort(wPtr); BeginUpdate(wPtr); LUpdate(wPtr->visRgn,theList); EndUpdate(wPtr); SetPort(theCurrentPort); } /* user update */ My reward for this effort? The menu bar locks up (can't pull down my menu) and about 30 seconds later La Bomba!! The ol' 02 error and the option of Restart or shoot the Mac. So, fellow sufferers, what could I possibly be doing wrong? We're talking LSC 2.14 and a vanilla Mac SE with no weirdness in the system file. I've read IM IVand the MacTutor article (Vol3 #4) but still can't see it. Mucho Obligado for any help. Email or post at your discretion. Programmatically yours, Arthur the List Slayer Arthur_Bebak@cup!portal.com {ucbvax,decwrl,decvax,seismo,hplabs}sun!cup.portal. com!Arthur_Bebak "Never explain, never apologize!"