Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!csus.edu!ucdavis!iris!lim From: lim@iris.ucdavis.edu (Lloyd Lim) Newsgroups: comp.sys.mac.programmer Subject: Re: Insertion point in cdev. Message-ID: <8781@ucdavis.ucdavis.edu> Date: 15 Apr 91 19:39:41 GMT References: <1991Apr15.043144.13345@ux1.cso.uiuc.edu> Sender: usenet@ucdavis.ucdavis.edu Reply-To: lim@iris.ucdavis.edu (Lloyd Lim) Organization: U.C. Davis - Department of Electrical Engineering and Computer Science Lines: 29 In article <1991Apr15.043144.13345@ux1.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes: >I have encountered a small problem in my cdev. I want to turn an >EditText box into a StatText box on the fly as part of my initDev >routine; under certain conditions, I want one of my text boxes not >to be editable. So I do the following (in C): > > GetDItem(CPDialog, ITEM_NUMBER + numItems, &tempType, &tempHandle, &tempRect); > SetDItem(CPDialog, ITEM_NUMBER + numItems, statText, tempHandle, &tempRect); > >Well, that works fine, except for the fact that I still have the cute >little insertion point flashing in my now apparently static text field. >How do I get rid of it? These comments apply to any dialog. A direct method is to fiddle with the editField in the DialogRecord. A better, more compatible way (IMHO), is to call HideDItem and ShowDItem. If the item you're hiding is the current editText item, HideDItem either moves the insertion point to another editText item or gets rid of it if there aren't any others. Yes, I confess. I know this because I've abused the Dialog Manager in the past with some dynamic dialogs - not because I know IM by heart. :-) +++ Lloyd Lim Internet: lim@iris.eecs.ucdavis.edu America Online: LimUnltd Compuserve: 72647,660 US Mail: 215 Lysle Leach Hall, U.C. Davis, Davis, CA 95616