Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!gargoyle!dawyd From: dawyd@gargoyle.uchicago.edu (David Walton) Newsgroups: comp.sys.mac.programmer Subject: Set/GetDItem (was Re: Moving a Textedit field in a modal dialog) Summary: Some corrections... Message-ID: <456@gargoyle.uchicago.edu> Date: 21 Aug 89 16:56:54 GMT References: <15088@dartvax.Dartmouth.EDU> <21428@cup.portal.com> <58078@tut.cis.ohio-state.edu> Reply-To: dawyd@gargoyle.uchicago.edu.UUCP (David Walton) Organization: U. Chicago Computer Science Dept. Lines: 33 In article <58078@tut.cis.ohio-state.edu> Scott Sutherland writes: >The problem with this is that SetDItem (which places the item in the given >dialog's item list) pre-supposes that the item is NOT already in the list. >Unless I am misunderstanding you, you already have the item in your list, >if not at first then at least when it is time to move the TE field offscreen. > >Also see the note on IM I page 422 (just below the description of SetDItem) >that says "Do not use SetDItem...to change or move a control." Ummmm...I'm confused. Actually, Scott, I think you are. :-) Get/SetDItem presupposes that the item in question IS in the list, because they use the index of the item in the list (the item number) to access it (this is how GetDItem is able to return a handle to the item). Perhaps I'm misunderstanding what you wrote, but it sounds like what you're saying is that SetDItem installs a new item in the item list. As to changing or moving controls: IM I-422 says to not change or move the SETTING of a control (i.e., dials, stuff like that). What that means is that you should use the Control Manager calls to change the settings of controls (by coercing the itemhandles returned by GetDItem to controlhandles). And editText and statText items, I believe,are not technically controls. Anyway, I used Get/SetDItem to hide two editText items before I noticed HideDItem and had no problems. (Of course, maybe the other bugs in the code were so much more obvious that I just didn't notice...;-) David -- David Walton Internet: dawyd@tartarus.UChicago.EDU U. Chicago Computer { Any opinions are my own, not those } Science Macintosh Lab { of my employers (or anybody else). }