Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!malgudi!sunc.osc.edu!cis.ohio-state.edu!sample.eng.ohio-state.edu!purdue!news.cs.indiana.edu!samsung!usc!wuarchive!udel!burdvax!dave From: dave@PRC.Unisys.COM (David Lee Matuszek) Newsgroups: comp.sys.mac.programmer Subject: Basic DLOG/DITL question Message-ID: <17230@burdvax.PRC.Unisys.COM> Date: 15 Apr 91 13:40:55 GMT Sender: news@PRC.Unisys.COM Organization: Unisys Corporation, Paoli Research Center; Paoli, PA Lines: 75 OK, I'm missing something really fundamental here. I have a very simple application, with a DLOG 128 whose DITL ID is set to 128. It's initially visible and is purgeable. This is my only window. I have a DITL 128. It has three static texts, two editable texts, 11 radio buttons, an OK button, and an icon. It's purgeable. Both these resources were created with ResEdit 2.1. In THINK Pascal 3.0 I call myDialog := GetNewDialog(128, nil, WindowPtr(-1)); and the DLOG window appears. But nothing appears in the window. When I call GetDItem(myDialog, editText1, itemType, itemHandle, itemRect); SetIText(itemHandle, myString); the appropriate editable text item appears. For the radio buttons, when I call GetDItem(myDialog, radioButton4, itemType, itemHandle, itemRect); SetCtlValue(ControlHandle(itemHandle), 1) the radio button appears, but if I call SetCtlValue with 0 instead of 1, it doesn't. If I call DrawControls(myDialog); this makes all the radio buttons and the one button appear, but does not make the static or editable text items or the icon appear. Here's where it gets weird. If the radio buttons are visible and I call HideDItem(myDialog, radioButton4) then the indicated radio button disappears; and when I call ShowDItem(myDialog, radioButton4) it stays gone. (DrawControls will bring it back, though.) (Note: editText1 and radioButton4 are small integers, in the range 1..18, corresponding to the DITL item numbers.) Enabling or disabling the various controls should have no effect, and in fact it does not. I know I'm doing something really stupid here; I recognize the symptoms of a dumb mistake. Unfortunately the fact does not help me figure out what it is. As near as I can tell, the connection between the DLOG and the DITL is not being made properly, but it sure looks OK in ResEdit 2.1. Help? [PLEASE don't assume someone else will answer; I don't mind getting lots of e-mail, but I dread getting none.] P.S. MacIIsi, System 6.0.7. -- Dave Matuszek (dave@prc.unisys.com) I don't speak for my employer. -- ------------------------------------------------------------------------- | When I was young, my family bought a color TV. Our neigbors, who | | were poorer, had only a black-and-white set. They bought a piece of | | cellophane, red on top, yellow in the middle, and blue on the bottom, | | and taped it over their screen, so they could claim that they had a | | color TV, too. | | Now there's Windows 3.0. | -------------------------------------------------------------------------