How do I store a new Rect information (C#)

If I want to create a button I need to use new Rect(10,10, 100, 50) and so on.

How can I store the Rect information so I can then use something like

if (GUI.Button (rectButton1, “a button!”))

How do I define rectButton1 ? I can’t figure out the syntax.

public Rect rectangle = new Rect(10, 10, 100, 50);

void OnGUI() {
   if(GUI.Button(rectangle, "a button")) {
      //do stuff
    }
}

Not, to hard, heres a youtube video it helped me to make things like that gives you scripts that you can use to your advantage. Building A Game In Unity Part 1: The Main Menu Tutorial 2/2 - YouTube

Storing the Rect information and using it doesn’t work even though it’s the same info presumably… Anyone know why? It’s as if you use the same information twice, looks like it.

public Rect mid = new Rect (Screen.width * 0.5f, Screen.height * 0.5f, Screen.width * 0.5f, Screen.height * 0.5f);

Solved it: For it to work it has to run inside of a public void. The code, as written above, needs “public” removed for it to work.