How do I make buttons that turn into a text field?

How do I make buttons that turn into a text field?

I want it so the user sees buttons on the screen and when clicked they turn into a text field that has several lines of text. With the option of closing the field which then reverts back to a button ready to be clicked again.

Please help this unity nub!

You need to use the same rect for both of them. And probably a similar style as well, so it doesn't look weird. Then Do something like that :

var useTextField : bool = false;
function OnGUI(){
if( !useTextField  )
    if( GUI.Button( rect, "Press button to write" ) ) useTextField = true;
else 
    GUI.TextField( rect, ...)
}

I left the closing the textfield to you, good luck !

Well, you can have something like this-

bool isATextField;
string fieldText;

void OnGUI()
{
    if(isATextField)
    {
        fieldText = GUILayout.TextField(fieldText);
        isATextField = !GuiLayout.Button("Close");
    } else {
        isATextField = GuiLayout.Button("Be a Text Field!");
    }
}