How come GUI window are not close according

var isWrong = false;

function Update()
{

.
.
.

else if(selected_00.GetComponent(textOnMouse00).thisRadical.ID != selected_0.GetComponent(textOnMouse0).thisRadical.ID)
{

				isWrong = true;
				//score   -= 500;
			}
		}
	}



function OnGUI()
{
	  
	if(isWrong)
	{
		GUI.Window(0, Rect((Screen.width/2)-90, (Screen.height/2)-190, 300, 150), showGUI, "I'm Sorry!!");
	}
	
}

function showGUI()
{

if(isWrong)
{

// You may put a label to show a message to the player

GUI.Label(Rect(65, 50, 200, 80), "Boo..Boo.. WRONG WORDS!!!");

}
	
// You may put a button to close the pop up too 

if (GUI.Button(Rect(60, 90, 75, 30), "OK"))

{

isWrong = false;

}

}

I would like to ask what wrong with my code. It can’t seem to close the window if i click ok.

It’s possible that the conditional that sets isWrong = true continually evaluates to true, i.e. selected_00.GetComponent(textOnMouse00).thisRadical.ID is never equal to selected_0.GetComponent(textOnMouse0).thisRadical.ID, so even if the Window’s Ok-button sets isWrong = false, it gets set right back to true next time Update executes. If I were you, I’d insert a call to Debug.Log inside that if-statement and see if it gets printed to the console continually.