Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!apple!han From: han@Apple.COM (Byron Han, wyl E. coyote ) Newsgroups: comp.sys.mac.programmer Subject: Re: List Manager Problem Message-ID: <27338@apple.Apple.COM> Date: 15 Mar 89 17:32:39 GMT References: <11032@ut-emx.UUCP> <6704@hoptoad.uucp> <11103@ut-emx.UUCP> <936@lts.UUCP> <855@dinl.mmc.UUCP> Organization: Apple R&D - Networking & Communications Lines: 62 In article <855@dinl.mmc.UUCP> snow@dinl.uucp (john snow) writes: > > With the current interest in List Manager problems I thought I >would check my system out to see how it worked. Well, it doesn't. Based >on some previously posted code, I tried the following: > >SetRect (&Bounds, 0, 0, 1, 0); /* Specify initial 1x0 list*/ >SetPt (&cSize, 0, 0); /* calculate the cell cSize */ >View.right -= 16; /* Allow for scroll bars */ What is View initialized to? right now view consists of (garbage, garbage, garbage, garbage-16) Or am I just confused? >hList = LNew (&View, &Bounds, &cSize, 0, myWindow, FALSE, FALSE, FALSE, TRUE); Which compiler are you using? MPW C 3.0 wants the point for cSize to be passed as is, rather than via &cSize. >View.right += 16; >(**hList).selFlags = lDoHAutoscroll + lOnlyOne; >LAddRow(10,0,hList); /* Insert rows */ You might want to check the returned value from LAddRow. > >for (x = 0; x < 10; x++) { > SetPt (&Where, 0, x); /* select the cell */ > LSetCell (Msgs[x], strlen(Msgs[x]), &Where, hList); Once again, some compilers (MPW C 3.0 for instance) want Where passed in without the &. >} >LDoDraw (TRUE, hList); You should have done a LDoDraw(FALSE, hList) prior to LAddRow if you are trying to avoid flicker when adding rows. You also need to explicitly generate an update event for the list area to force a redraw. >Nothing crashes, and I do get the scroll bar, This is because controls when created are drawn immediately (unless they are invisible of course) >but nothing else is displayed. >If I go back with LGetCell after LSetCell, it says there is nothing there. >Msgs is an array of strings, and it doesn't matter what size the initial >list is set for. Whats going on here??? +-----------------------------------------------------------------------------+ | Disclaimer: Apple has no connection with my postings. | +-----------------------------------------------------------------------------+ Byron Han, Communications Architect Cereal, anyone? :-) A1! Apple Computer, Inc. ------------------------------------- 20525 Mariani Ave, MS27Y Internet: han@apple.COM Cupertino, CA 95014 UUCP:{sun,voder,nsc,decwrl}!apple!han -------------------------------------- GENIE: BYRONHAN ATTnet: 408-974-6450 Applelink: HAN1 CompuServe: 72167,1664 ------------------------------------------------------------------------------