Path: utzoo!attcan!uunet!wuarchive!uwm.edu!mailrus!iuvax!bsu-cs!mithomas From: mithomas@bsu-cs.bsu.edu (Michael Thomas Niehaus) Newsgroups: comp.sys.mac.programmer Subject: List Manager strangeness Message-ID: <10152@bsu-cs.bsu.edu> Date: 22 Sep 89 15:09:55 GMT Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 73 I am trying to get the List Manager to keep a list of items for me in a modeless dialog. So far, everything works as planned, but I occasionally get strange behaviors. For example, sometimes I can select the first item in the list, then click on the second (with no modifier keys) and still manage to select both cells. Double clicking on any cell does not get LClick to return true, unless the above behavior is also happening at the same time. Does anyone know what is going on? For diagnostic purposes (and general interest), I have included the portion of source code that creates the dialog, replaces the userItem with the list update routine, etc. Does anyone see any problems with this? Thanks for any help. (By the way, this is from my Booz program, the Zoo archive extracting application. I have posted this to comp.binaries.mac, but nothing I have ever sent there has made it past the moderator. I guess it is not seen as useful. This code is actually from my latest version, but the version that I posted has the same behavior, annoying but not severe.) -Michael SetDAFont(21); localDialog=GetNewDialog(133,0,-1); SetWTitle((WindowPtr) localDialog,whatFile); SelectWindow( (WindowPtr) localDialog); SetPort(localDialog); SetDAFont(0); csize.v=0; csize.h=199; SetRect(&viewRect,10,10,200,200); SetRect(&dataBounds,0,0,1,0); GetDItem( localDialog, 2, &itemType, &theItemHandle, &theItemRect ); SetDItem( localDialog, 2, itemType, UpdateList, &theItemRect ); localList = LNew(&viewRect,&dataBounds,csize,0,localDialog, true,false,false,true); SetWRefCon(localDialog,(long) localList); LActivate(true,localList); /* Open file, read header and entries. */ SetFPos(localFile, 1,zoo_header.zoo_start); theCell.h=0; theCell.v=-1; rd_dir(&direntry,localFile); while (direntry.next != 0L ) { if (direntry.lo_tag != LO_TAG || direntry.hi_tag != HI_TAG) { prterror (stopAlert, "\pBad entry in archive"); err=-1; break; } theCell.v=LAddRow(1,theCell.v+1,localList); if (direntry.namlen==0) LSetCell(&(direntry.fname), strlen((char *) &(direntry.fname)),theCell,localList); else LSetCell(&(direntry.lfname),direntry.namlen, theCell,localList); SetFPos (localFile, 1, direntry.next); rd_dir (&direntry,localFile); } LUpdate( (localDialog)->visRgn,localList); -- Michael Niehaus UUCP: !{iuvax,pur-ee}!bsu-cs!mithomas Apple Student Rep ARPA: mithomas@bsu-cs.bsu.edu Ball State University AppleLink: ST0374 (from UUCP: st0374@applelink.apple.com)