Path: utzoo!attcan!uunet!samsung!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: List Bummers Message-ID: <9037@hoptoad.uucp> Date: 21 Nov 89 19:29:07 GMT References: <9013@hoptoad.uucp> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 57 In article es2q+@andrew.cmu.edu (Erik Warren Selberg) writes: >ok... list bummer revisited: I'm using a home-made list object (TList) >which has all the calls I want to make imbedded, along with an internal >list:listHandle; data object. The problem is during a normal event, when >I get an update for the window, the window itself updates, and the >scroll bars hilight and the previously selected cell is once again >selected as normal. The only problem is that the list won't accept any >clicks. I can't solve this, but I can suggest some things to look at that might help you solve it. (1) Is LClick getting called? If so, is it getting passed an appropriate click location? Is the port set to the list's port when you call LClick? You can find all this out by placing a debugger breakpoint. (2) Do clicks work on the scroll bar, but not on the list body? If so, it is very likely some sort of problem with the way your LDEF is handling hiliting. If not, it is very likely some sort of problem with the way you are calling LClick. (3) Despite the visual appearance of the list, is selection actually being done? This could indicate a clipping problem. In general, I have found that it is often a bad idea to mess with clipping in an LDEF, but if you do, be sure to restore the old state on exit. You can tell whether selection is actually being done correctly a gfew different ways. Given your description of behavior, I would expect the best way would be to replicate the problem, click on an unselected cell, hide the window behind another window, then bring it back to the front and see if the cell you clicked is hilited. >BTW: in terms of the using ptrs in a list def, you aren't quite >understanding (although I might just have got a clue on how to >do it another way). What I want to do is pass each pointer in a linked >list (all the data) to the list so it can handle it. I was thinking >along the lines of putting the pointer address in the cell (so each >entry would be 4 bytes long, but that crapped out). Is there any other >way to do this, or would I be stuck putting it into the refCon and using >a list reference type thing for the data? Uh -- I'm afraid I'm still not clear on this. What is the problem with putting the pointers from your linked list into the cell, and having your LDEF pull them out and dereference them? That ought to work fine. What do you mean, it crapped out? If for some reason you just can't do this, then put the header of the linked list in your list's refCon, and have all the cells be empty. Then your LDEF can easily find its data just by iterating down the list based on the cell index. If it's a one-column list, then just go to list entry number cell.v. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "Every institution I've ever been associated with has tried to screw me." -- Stephen Wolfram