[comp.sys.mac.programmer] Dialog not working?!?!

jwright@atanasoff.cs.iastate.edu (Jim Wright) (09/08/89)

I'll try to be brief, but... :-)  I have a modal dialog that is driving
me up the wall.  The items of interest here are four rows of three items
each.  Each of the items activates a popup window.  The four items in
column one share a common menu structure (drugs), while columns two and
three share a common menu structure (identification procedure).  My
problem is, I can't get the item in the first row, first column initialized
on screen before going into the modal dialog loop.

A psuedo-code initialization would be:

	/* get new dialog and fill in a bunch of stuff... */
	for row = 1 to 4
		GetDItem(DLOG, drugID+row-1, tmpType,tmpItem,tmpBox)
		if drug[row] <> 0
			SetIText(tmpItem,DrugList[drug[row]])
		else
			SetIText(tmpItem,' ')

		/* same sort of thing for column two, identification */

		/* same sort of thing for column three, confirmation */

	end
	/* set the fields to call the popup menu routines... */
	/* then do the modal dialog loop... */

The problem is that no matter what I do, row one column one always
comes out blank.  Except if I single step through the code using the
Think Pascal debugger!  Then everything works as advertised.  I even
put a SysBeep(1) in before the first SetIText call above, so I could
tell that the code is getting through to the proper branch of the
conditional.  It gets through and executes the proper SetItext statement,
but the item on screen still starts out blank.  This is driving me crazy!!!!

I've been through this forwards, backwards, sideways and upside-down.
Either I've come up with the most obscure error possible, or there is
a bug in the system.  Help!  Please!!

-- 
Jim Wright
jwright@atanasoff.cs.iastate.edu