C# tooltips

Cant seem to get my ToolTips working most accurate i get is the full list showing and not on what button my mouse is hovering.

any solution?


using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class Wmenu : MonoBehaviour{
	
	private GUISkin SubMenu;
	
	// knoppen
	
	public float buttonWidth = 250;
	public float buttonHeight = 30;
	public float closeWidth = 20;
	public float closeHeight = 20;
	
	private float yOffset = 10;
        private float Spacing  = 25;
		
	private float Gap;
	
	private bool SUBMENU = false;
	private bool pressed = false;
	private const int SubMID = 0;
	private Rect SubMRect = new Rect(10, 10, 280, 300);
	private Rect ViewerRect;
	
	private GameObject[] Locations;
	
	public Transform Char;
	
	private Vector2 Slider = Vector2.zero;
	
	private string Warp = "";
	private string Info = "";
	private int infoIndex;
	
	int WarpIndex;
	
	void Start () 
	{
	    Locations = GameObject.FindGameObjectsWithTag("Locaties");	
	}
	
	void OnGUI()
	{
	    if(SUBMENU)
		{
		    SubMRect = GUI.Window(SubMID, SubMRect, Smenu, "SubMenu");
    

 //=============== calling the guibox where i want the info to show ==================\\
		    GUI.Box(new Rect(70, Gap, 150, buttonHeight), new GUIContent(Info));	
		}		
	}
	
	void Update () 
	{
		if(Input.GetKeyDown(KeyCode.M) && SUBMENU == false && pressed == false)
			{
				pressed = true;
				SUBMENU = true;
				MouseLook.canControl = false;
			}
		if(Input.GetKeyDown(KeyCode.M) && SUBMENU == true && pressed == false)
			{
				SUBMENU = false;	
				pressed = true;
				MouseLook.canControl = true;
			}		
		if(Input.GetKeyUp(KeyCode.M))
			{
				pressed = false;	
			}
		if(Input.GetKeyDown(KeyCode.N)&& SUBMENU == true &&pressed == false)
		{
			pressed = true;			
		}
		if(Input.GetKeyUp(KeyCode.N))
		{
			pressed = false;	
		}
	}

// Warp Menu	

	public void Smenu(int id)
	{
		ViewerRect = new Rect(10, 20, 250, 270);		
		Slider = GUI.BeginScrollView(new Rect(ViewerRect), Slider, new Rect(0,25,0,Gap - 40));
		
		Gap = yOffset + Spacing;
		
		for(int i = 0; i < Locations.Length; i++)
		    {
				Warp = i.ToString();
				infoIndex = i;
 //=============== caUpdating the info string to show the button info =================\\
			Info = Locations[infoIndex].name + infoIndex.ToString();

//====== The array of buttons which update when a location is added or removed ======\\
                        if(GUI.Button (new Rect (25, Gap, buttonWidth, buttonHeight),Warp))
						{
				        
			            Char.transform.position =
						new Vector3(Locations*.transform.position.x,*
_				                    Locations*.transform.position.y + 2,*_
<em>_				                    Locations*.transform.position.z);	*_</em>
<em>_*						}					*_</em>
<em>_*					Gap += 55;*_</em>
<em>_*			}*_</em>
 
<em>_*		GUI.EndScrollView();*_</em>
 
<em>_*		GUI.DragWindow();						*_</em>
<em>_*	}*_</em>
 
<em>_*}*_</em>
<em>_*```*_</em>

solved while experimenting with the code for a bit

Solution. ==== make more functions :s


void OnGUI()
	{
		if(SUBMENU)
	       {
	         SubMRect = GUI.Window(SubMID, SubMRect, Smenu, "SubMenu");
	       }
    // == added to rewrite the tooltip when the mouse is not on top of it
    // == resetting the tooltip to its default value wich is ""
		ShowTT();
	}
    public void Smenu(int id)
	{
		ViewerRect = new Rect(10, 20, 250, 270);
		Slider = GUI.BeginScrollView(new Rect(ViewerRect), Slider, new Rect(0,25,0,Gap - 40));
		Gap = yOffset + Spacing;
		
		for(int i = 0; i < Locaties.Length; i++)
        {
			Warp = i.ToString();			
			
			
      		 if(GUI.Button (new Rect (25, Gap, buttonWidth, buttonHeight),new GUIContent(Warp,Locaties*.name)))*
 *{*
 *Char.transform.position =*
 _	 new Vector3(Locaties*.transform.position.x,*_
 <em>_Locaties*.transform.position.y + 2,*_</em>
 <em><em>_Locaties*.transform.position.z);*_</em></em>
<em><em>_*			  }*_</em></em>
<em><em>_*			Gap += 55;*_</em></em>
<em><em>_*	     }*_</em></em>
 
<em><em>_*		GUI.EndScrollView();*_</em></em>
<em><em>_*		GUI.DragWindow();*_</em></em>
 <em><em>_*// ==== added here so it imports the information into the tooltip*_</em></em>
<em><em>_*		UpdateTT();*_</em></em>
<em><em>_*	}*_</em></em>
<em><em>_*// ===== added these to update and show the text inside the tooltip ==== \\	*_</em></em>
<em><em>_*	private void UpdateTT()*_</em></em>
<em><em>_*	{*_</em></em>
<em><em>_*		if(Event.current.type == EventType.Repaint && GUI.tooltip != Info)*_</em></em>
<em><em>_*		{*_</em></em>
<em><em>_*			if(Info != "")*_</em></em>
<em><em>_*			{*_</em></em>
<em><em>_*				Info = "";*_</em></em>
<em><em>_*			}*_</em></em>
<em><em>_*			if(GUI.tooltip != "")*_</em></em>
<em><em>_*			{*_</em></em>
<em><em>_*				Info = GUI.tooltip;*_</em></em>
<em><em>_*			}*_</em></em>
<em><em>_*		}*_</em></em>
<em><em>_*	}*_</em></em>
 
<em><em>_*	private void ShowTT()*_</em></em>
<em><em>_*	{*_</em></em>
<em><em>_*		if(Info != "")*_</em></em>
<em><em>_*		{*_</em></em>
<em><em>_*			GUI.Box(new Rect(Screen.width / 2 - 100, 10, 200, 100),Info);*_</em></em>
<em><em>_*		}*_</em></em>
<em><em>_*	}*_</em></em>
 
<em><em>_*```*_</em></em>