AlertWindow with textEdit in TimerCallback Help


#1

I’m trying to figure out how to either pause the timer or do a callback to start the timer that way the server can validate the text input from the user. It always passes null then when closing modal it startimer then validates. Can someone please help me figure out this? Should I use a different alertWindow with async?

Here’s the timerCallback:

void ProjectAudioProcessorEditor::timerCallback()
{

	stopTimer();

	AlertWindow w("AW demo", "stuff", AlertWindow::QuestionIcon);
	w.addTextEditor("text", "Enter stuff here", "Enter Stuff");
	w.addButton("OK", 1, KeyPress(KeyPress::returnKey, 0, 0));
	w.addButton("Cancel", 0, KeyPress(KeyPress::escapeKey, 0, 0));



	if (w.runModalLoop() != 0)
	{
		name = w.getTextEditorContents("text");
		startTimer(200);

	}

	String url = "http://www.site.com/Call.php?test=" + name;
	URL authURL(url);
	InputStream *input = authURL.createInputStream(false);
	String result = input->readString();

	//Always returns false. 

}

#2

Hi @cocell,

I’m not too sure what you’re trying to accomplish here. Why do you start the timer again when the user has clicked OK on the AlertWindow?

Ed


#3

Hello, im trying to add a user name and password validation sent to server in order to use plugin. The reason the timer starts again is for the other parameters to update. Hope this makes sense.


#4

Check out this thread about using AlertWindow in a Plug-In

Rail