GUI disappear on yield

I got a function called Spin() that is called when a user press a button drawn on OnGUI(). That function, at some point, says something like this:

var url : String = "mysampleurl";	    
var query : WWW = new WWW (url);    		
yield query;	

The things is that when Unity is waiting for query, the GUI disappears. If if comment that line, the GUI shows perfectly. How I need to write my code in order to have the GUI showing correctly and still wait for the query result?

EDIT: The code is from the function Spin() that’s called on OnGUI();

Because the query part is asynchronous, you need to make sure that gets split off into a separate Coroutine, instead of forcing the GUI to wait for it to finish. Keep a boolean variable outside of both functions, that takes care of the yield timing:

querying = true;
yield query;
querying = false;

GUI.enabled = !querying;
if(GUI.Button(whatever))
{
    StartCoroutine(Spin());
}
GUI.enabled = true;