Simply question (Button opening new box)

Hi, im learning Unity3D and right now im with the 2D Platform tutorial…
I want to do one thing but i dont know how.

There is one funcion that makes a window and there you can selec the character you want (with a camera focuse script, etc)
Well , i want to make a button only for when i press it, that wndow with the character select appears and when i click it again, that window will close…
this is the funcion:

 function OnGUI () {
	GUI.skin = guiSkin;
	
	windowRect = GUILayout.Window (0, windowRect, DoControlsWindow, "Controls");
	windowRect.x = Mathf.Clamp (windowRect.x, 0.0, Screen.width - windowRect.width);
	windowRect.y = Mathf.Clamp (windowRect.y, 0.0, Screen.height - windowRect.height);
}

well , what i want to do is a button for open thhe character controll window!!
I think is with booleans but i dont know exactly how in this code…
Thanks a lot
bye

private var mybool : boolean;

function OnGUI () {
	GUI.skin = guiSkin;
	if(Event.current.type == EventType.KeyUp  Event.current.keyCode == KeyCode.F) mybool = true
        {
            if(mybool)
            {
            windowRect = GUILayout.Window (0, windowRect, DoControlsWindow, "Controls");
	    windowRect.x = Mathf.Clamp (windowRect.x, 0.0, Screen.width - windowRect.width);
	    windowRect.y = Mathf.Clamp (windowRect.y, 0.0, Screen.height - windowRect.height);
            }
        }
}

u can set a boolean and do so
public boolean _show = false;
if(GUI.Button(new Rect (x,y,w,h),“Button name or texture”))
{
_show = !_show;
}

if(_show)
{
///The code of the window which you want to show when the button is clicked
}