Why would a button shows tooltip when it has none ?!!

Hello

Does anyone know why would a button shows another button tooltip while it has no tooltip itself ??

in other words
I have a button that doesn’t have any tooltip passed in the code, it only have a string and the style
like this one

        if (GUI.Button(new Rect(x, y , z, m), "Send", SkinStyles.SendButton.ToString()))
        {
            //some code
        }

yet it shows a tooltip of another button (randomly) , and what is more weird is that it shows that tooltip when it is pressed down!!
hovering over that button doesn’t show any tooltip, only when holding mouse button down it shows that another button’s tooltip

Any suggestions would be much appreciated
Thanks

can u post the exactly code how it look like it

I don’t think posting the code would help much as it contains many custom classes and enums and it will be hard for someone to follow the code and find the cause of this issue but I will try to quote some parts of it

void OnGUI()
{
hotKeysWindow.WindowRect = GUI.Window((int)WindowsIDs.HotKeys, hotKeysWindow.WindowRect, HotKeysWindowFunc, "", SkinStyles.MainWindow.ToString());

/* some codes

*/

// code for tooltip window
GUI.Window((int)WindowsIDs.ToolTip, tooltipWindow.WindowRect, ToolTipWindowFunc, "", SkinStyles.ToolTipWindow.ToString());

}

// following code is for a window that have some buttons with tooltips
    void HotKeysWindowFunc(int windowID)
    {

        for (byte i = 0; i < HotKeysList.Count; i++) // HotKeysList is a list of a custom class
        {
            if (GUI.Button(new Rect(40 * (HotKeysList[i].ID - 1) + 20, 5, 40, 40), HotKeysList[i].ButtonDisplay(),HotKeysList[i].HotKeyStyle()))
            {
              //ButtonDisplay() return GUIContent that have a tooltip
              //HotKeyStyle() returns a string that match a custom style

             //Some codes here

            }

        GUI.DragWindow();
    }

//The following part is for the window , no tooltip in any control here
    void ChatWindowFunc(int windowID)
    {
        GUI.SetNextControlName("ChatBox");
        myChat.Message = GUI.TextField(new Rect(5, chatWindow.WindowRect.height - 60, chatWindow.WindowRect.width - 50, 50), myChat.Message, SkinStyles.ChatTextField.ToString());

// This button displays a tooltip of another button in another window like the first window, only when holding mouse buuton down on it !!, no tooltip shows when I hover over it
        if (GUI.Button(new Rect(chatWindow.WindowRect.width - 45, chatWindow.WindowRect.height - 60, 40, 30), "Send", SkinStyles.LoginButton.ToString()))
        {
           //Some functions
        }

        if (Input.GetKeyUp(KeyCode.Return))
        {
            if (GUI.GetNameOfFocusedControl() != "ChatBox")
            {
                GUI.FocusWindow((int)WindowsIDs.Chat);
                GUI.FocusControl("ChatBox");
            }
        }

        if (Event.current.Equals(Event.KeyboardEvent("None")))
        {
            //Some functions
            return;
        }
    }

// the following is the code of the tooltip window

    void ToolTipWindowFunc(int windowID)
    {
        if (Event.current.type == EventType.Repaint  GUI.tooltip != "")
        {
            tooltipWidth = Skin.FindStyle(SkinStyles.ToolTipLabel.ToString()).CalcSize(new GUIContent(GUI.tooltip)).x + 20;
            tooltipHeight = Skin.FindStyle(SkinStyles.ToolTipLabel.ToString()).CalcSize(new GUIContent(GUI.tooltip)).y + 10;

            GUI.Label(new Rect(0, 0, tooltipWidth, tooltipHeight), GUI.tooltip, SkinStyles.ToolTipLabel.ToString());
        }
        GUI.BringWindowToFront((int)WindowsIDs.ToolTip);
    }

I hope you can find something here causing the issue, or if you have a better implementation for the tooltip other than this

Thanks

I still can’t figure why the tooltip of another button shown when I hold mouse button down on a button that doesn’t have any tooltip :frowning: