How do you horizontal group toggle controls

Hi All,

I am adding a control to the inspector window and want to have a row of toggle controls, well a grid actually, exactly like the one you see when you go to Project->Physics to enable and disable the collision stuff.
I can get sort of horizontal layout but there is a huge gap inbetween controlls. How do I bunch them up nice and tight as in the Project->Physics control? Here is my code that does it badly.

   public override void OnInspectorGUI()
  {
    int x, y;
    bool state;

    if(_target.MapEditorToolName == "")
    {
      _target.MapEditorToolName = _target.initialName;
    }

    EditorGUILayout.BeginVertical();

    EditorGUILayout.PrefixLabel("Name");
    _target.MapEditorToolName = EditorGUILayout.TextField(_target.MapEditorToolName, GUILayout.ExpandWidth(false));

    EditorGUILayout.Separator();
    EditorGUILayout.Separator();

    for(y = 0; y < gridys; y++)                                      /* fetch grid */
    {
      EditorGUILayout.BeginHorizontal();
      for(x = 0; x < gridxs; x++)
      {
        if(grid[y, x] == 0)
          state = false;
        else
          state = true;
        EditorGUILayout.Toggle("", state, GUILayout.ExpandWidth(false));
      }
      EditorGUILayout.EndHorizontal();
    }

    EditorGUILayout.EndVertical();

    //update and redraw:
    if(GUI.changed)
    {
      EditorUtility.SetDirty(_target);
    }
  }

Try using regular GUILayout.Toggle which doesnt put a space in for label.

Thanks BDev, my final solution was very satisfying so I thought I’d post it here to help out anyone else trying to make an
in editor grid of int controls.

    for(y = (gridys-1); y >=0; y--)                                   /* fetch grid */
    {
      EditorGUILayout.BeginHorizontal();
      EditorGUILayout.PrefixLabel(y.ToString(), MapEditStyle, MapEditStyle); 
        
      for(x = 0; x < gridxs; x++)
      {
          EditorGUILayout.IntField(grid[y, x], GridEditStyle_empty, GUILayout.Width(16));
      }
      EditorGUILayout.EndHorizontal();
    }

you just need to create 2 styles, one for the left hand labels and one for the actual grid