6090617@pucc.BITNET (Robert Wald) (06/23/86)
I'm having a problem passing a procedure pointer to a UserIterm procedure in Lightspeed C. Its taking place inside of a Desk Accesory whose window is a dialog box. I put in the pointer for the UserItem like GetDItem(dpeek,15,&itype,&ihandle,&rr); SetDItem(dpeek,15,itype,&MyItem,&rr); The function is defined as pascal void MyItem(theWindow,itemNo) WindowPtr theWindow; int itemNo; The function is never getting called. I have a SysBeep(3) at the beginning to see if it ever is called. Also a Static Text item is never drawn which comes after the myProc in the item list. Everything works fine if I don't try to replace the pointer so I can use the UserItem, but I need the UserItem. Any Ideas? Another problem (academic): A dialog within a Desk Acc. is supposed to work with all Dialog Mgr calls, but IsDialogEvent returns FALSE; I skip it and pass everything to DialogSelect. Is this right? ------------------- Nexus -------------------- -Rob Wald (PUCC User Services) BITNET: 6090617@PUCC UUCP: ...ALLEGRA!PSUVAX1!PUCC.BITNET!6090617 "Behold, I teach you the Superman! "He isn't Trent Phloog. He is this Lightning He never will be Trent Phloog. He is this madness." He never was Trent Phloog."
dwb@well.UUCP (David W. Berry) (06/24/86)
In article <775@pucc.BITNET> 6090617@pucc.BITNET writes: > > I'm having a problem passing a procedure pointer to a UserIterm procedure >in Lightspeed C. Its taking place inside of a Desk Accesory whose window >is a dialog box. > >I put in the pointer for the UserItem like >GetDItem(dpeek,15,&itype,&ihandle,&rr); >SetDItem(dpeek,15,itype,&MyItem,&rr); The following has worked fine for me: dlog = GetNewDialog(AboutDialog, &aboutDialog, (DialogPtr) -1); GetDItem(dlog, AboutText, &type, &hand, &rect); type = userItem; hand = (Handle) DrawAboutItems; SetDItem(dlog, AboutText, type, hand, &rect); For what it's worth so did: SetDItem(dlog, AboutText, userItem, DrawAboutItems, &rect); and SetDItem(dlog, AboutText, userItem, &DrawAboutItems, &rect); My suggestion would be to make sure your da is locked and not moving about during the call. -- David W. Berry dwb@well.uucp dwb.Delphi dwb.GEnie 293-0544.408.MaBell DOWN WITH FASCIST APPLE!