[comp.sys.mac.programmer] Weird alert behavior

jverdega@cae.wisc.edu (Jeffrey Verdegan) (06/19/91)

I've observed some weird behavior in a couple of alerts lately.  I call

ParamText("\pSome text", "\p", "\p", "\p");
Alert(BLANK_ALRT, NULL);

where blank alert is the resource ID of an alert containing only an OK button
and a static text item.  In the static text, I have ^0, ^1, ^2, and ^3.  It
has worked in other parts of the program.  Now, when I put it in a new place to
monitor program execution, all that shows up is the window frame and the outline
of the OK button.  The "OK" isn't there, nor is the text.  I've also noticed
almost identical behavior with a modal dialog inside the same function.  The
outline of the buttons and the window frame appears, but none of the other
stuff.

Has anybody seen this before?

I'm running THINK C v4.0.5 on a IIci with system 6.0.5, if that makes a 
difference.

Thanks in advance! :-)

Jeff Verdegan
University of Wisconsin
Computer-Aided Engineering Center
jverdega@cae.wisc.edu

jverdega@engr.wisc.edu (Jeffrey Verdegan) (06/19/91)

An update on the problem.  It only happens the first time through the function.

someFunction()
{
	ParamText("\pStuff", "\p", "\p", "\p");
	Alert(BLANK_ALERT, NULL);
	/* Do some other stuff */
        ParamText("\pStuff", "\p", "\p", "\p");
        Alert(BLANK_ALERT, NULL);
	/* Do som more other stuff. */
	/* GetNewDialog, etc. */
	ModalDialog();
	DisposDialog();
}

The first time I call the function, all the alerts and the dialog draw window
frames and button outlines, but don't fill in other stuff.  On the second and
subsequent calls to someFunction, all the alerts and the dialog work fine. 
This seems to be independent of what other program options the user chooses 
before selecting the one that calls someFunction.

I'm stumped. :-|

Jeff Verdegan
University of Wisconsin-Madison
Computer-Aided Engineering Center
jverdega@cae.wisc.edu