Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!ut-sally!ut-ngp!jdm From: jdm@ut-ngp.UUCP Newsgroups: comp.sys.mac Subject: SetIText in LightSpeed C DA Message-ID: <5278@ut-ngp.UUCP> Date: Tue, 26-May-87 19:09:26 EDT Article-I.D.: ut-ngp.5278 Posted: Tue May 26 19:09:26 1987 Date-Received: Thu, 28-May-87 00:55:34 EDT Organization: UTexas Computation Center, Austin, Texas Lines: 50 Keywords: How do you get SetIText to Update the Text? I'm writing a desk accessory in Lightspeed C that puts up a simple dialog window with three EditText items. I have occasion to change the text of one of those items, using "SetIText," as I have done many times in various application programs. For some reason SetIText does not draw the new text, though Inside Mac says explicitly that it will do so (it doesn't generate an update event either). I have previously found SetIText works fine in applications. Now in the DA, I call "DrawDialog,", which does properly update the display of the item, but is kludgy since it redraws all the items, even the StatText. Anybody know why SetIText doesn't work, and/or what's a better way to draw the item? Here's a code fragment containing the call's I do: --------------------------------------------------------------- ... DCtlPtr dce; /* global: device control entry */ ... main(p,d,n) { ... } ... Handle DItemHandle(itemNo) / *returns a handle to the Dialog Item "itemNo" */ int itemNo; { Rect theRect; Handle itemHdl; int type; GetDItem(dce->dCtlWindow,itemNo,&type,&itemHdl,&theRect); return(itemHdl); } SetNo(theNo,itemNo) /* set the Dialog Item "itemNo" to the number "theNo" */ int itemNo; double theNo; { Str255 theText; ftoa(theText,theNo); /* convert theNo to a Pstring */ SetIText(DItemHandle(itemNo),theText); /* <-----The Offending Call */ DrawDialog(dce->dCtlWindow); /* Why is this necessary?? */ } ------------------------------------------------------------------ Thanks for your help Jim Meiss jdm@ut-npg.UTEXAS.EDU