GridSelection buttons in a foreach loop? C#

hi, I’ve been working on adding resolution buttons to my options menu and I’ve ran into a slight problem. I figured since the box is only 100 high it would force the buttons to grid up next to each other but its’ not doing that. I myself have tried to use a selection grid instead of the buttons but the buttons will not show up at all. What could I be doing wrong?

 GUI.Box(new Rect(800, 130, 300, 100), "");
        GUILayout.BeginArea(new Rect(800, 130, 100, 100));
        Resolution[] resolutions = Screen.resolutions;//gets all native resolutions
        foreach (Resolution r in resolutions)
        {
            if (GUILayout.Button(r.width + "x" + r.height))
            {
                screen_height = r.height;
                screen_width = r.width;
            }
        }
        GUILayout.EndArea();

alt text

YoHodiHO!

Take some minutes and look at this:

static function Rect (left : float, top : float, width : float, height : float) : Rect

And afterwards you copypasta this code instead

GUI.Box(new Rect(0, 130, 300, 100), "");
        GUILayout.BeginArea(new Rect(0, 130, 100, 100));
        Resolution[] resolutions = Screen.resolutions;//gets all native resolutions
        foreach (Resolution r in resolutions)
        {
            if (GUILayout.Button(r.width + "x" + r.height))
            {
                screen_height = r.height;
                screen_width = r.width;
            }
        }
        GUILayout.EndArea();