Actually do something with GUI selection grid

How do I get a selection grid to actually to something. Like how would I clicked which button on the grid has been pressed then do something.

Here is my code so far

var gridId : int;
    var gridRowX : int;
    var menueGrid : String[] = ["Health", "Crafting", "Melee", "Guns"];	
    
    
    
    var gridXPos : int; // temporaray;
    var gridYPos : int; // temporaray;
    var gridXSize : int;
    var gridYSize : int;
    
    
    
    function OnGUI(){
    	GUI.skin = mySkin;
    	if(menueActive){
    		GUI.BeginGroup(Rect(xPos,yPos,500,300), mySkin.GetStyle("base"));
    			GUI.SelectionGrid(Rect(gridXPos,gridYPos,gridXSize, gridYSize),gridId, menueGrid, gridRowX,mySkin.GetStyle("grid1"));
    			
    			Debug.Log(gridId);
    	
    		GUI.EndGroup();
    	}
    
    }

var selGridInt : int = 0;
var selStrings : String = [“Grid 1”, “Grid 2”, “Grid 3”, “Grid 4”];

function OnGUI () {
    selGridInt = GUI.SelectionGrid (Rect (25, 25, 100, 30), selGridInt, selStrings,2); 
    //selGridInt will change based on your selected box

   if (selGridInt==whatever){
      Debug.Log("stuff here");
   }
}