199 Milliseconds until you can place a second dialog?
by Dave Calabrese · in Torque Game Builder · 03/30/2005 (11:13 am) · 4 replies
Anyone else notice that if you pop a dialog, you cannot place a second one unless you make a timer for 200 milliseconds?
Meaning, the following code will not work:
Because the second dialog will exist - however will never make it to the screen layer.
So you have to do this:
Wild. Anyone else getting this?
Meaning, the following code will not work:
canvas.popDialog(this); canvas.pushDialog(thisOther);
Because the second dialog will exist - however will never make it to the screen layer.
So you have to do this:
canvas.popDialog(this); schedule(200,0,"codeThatDrawsYourDialog");
Wild. Anyone else getting this?
About the author
Recent Threads
#2
03/30/2005 (11:33 am)
I would think it to be, yes, just surprised that T2D dosen't multithread the two calls. I'm guessing that you can only have one canvas call going at one time or something?
#3
03/30/2005 (11:49 am)
Well, multithreading it would be overkill. But they could place those commands in a queue an execute them once the GUI update code is called.
#4
Torque is pathologically single-threaded. You can rely on it being single-threaded, and a lot of the time, you probably already do without realising it. You're garuanteed that your script is running 100% sequentially, and you should consider this to be a Good Thing(TM).
canvas.popDialog(this);
canvas.pushDialog(thisOther);
There is nothing that the engine does between those two calls. Torque is executing the script code, and until it finishes with that, it won't start doing anything else.
Grepping for ConsoleMethod in guiCanvas.cc, I see a repaint method, and a reset method.
Maybe between the two, you could try:
canvas.popDialog(this);
canvas.repaint();
canvas.pushDialog(thisOther);
or
canvas.popDialog(this);
canvas.reset();
canvas.pushDialog(thisOther);
This email is mostly speculations and three minutes poking about in source.
In fact, now I think about it, you could actually try putting either of those after the both of the other lines.
Gary (-;
03/30/2005 (12:12 pm)
Consider:Torque is pathologically single-threaded. You can rely on it being single-threaded, and a lot of the time, you probably already do without realising it. You're garuanteed that your script is running 100% sequentially, and you should consider this to be a Good Thing(TM).
canvas.popDialog(this);
canvas.pushDialog(thisOther);
There is nothing that the engine does between those two calls. Torque is executing the script code, and until it finishes with that, it won't start doing anything else.
Grepping for ConsoleMethod in guiCanvas.cc, I see a repaint method, and a reset method.
Maybe between the two, you could try:
canvas.popDialog(this);
canvas.repaint();
canvas.pushDialog(thisOther);
or
canvas.popDialog(this);
canvas.reset();
canvas.pushDialog(thisOther);
This email is mostly speculations and three minutes poking about in source.
In fact, now I think about it, you could actually try putting either of those after the both of the other lines.
Gary (-;
Torque Owner Laurent