Popup window size problem

Hi there!

I was trying to create a popup window in my game, but I’m having some problems with it. I tried this way:

var windowRect : Rect = Rect (20, 20, 1000, 1000);

function OnGUI () {
	windowRect = GUI.Window (0, windowRect, CreateWindow, "Popup Window");
}

function CreateWindow (ID : int) {
        GUI.DragWindow();
}

But, not matter which dimensions the windowRect has, the window does not get resized. Do you have any idea?

Also, sometime, after I modified my script in MonoDevelop, it looks like the game still run using the older script version, so I need to refresh the file in the Project. Is it normal?

So I was having the same issue as you, and as I was playing around with the code, I began to notice that changing the values in windowRect did not effect the size of the window being created. So I moved the code declaring windowRect out of global and into the OnGUI function, which seems to fix the problem. I’m still not sure why http://docs.unity3d.com/Documentation/ScriptReference/GUI.Window.html has the variable in global or why the global variable is not being used by the parameters of GUI.Window.