x


Odd behavior of gui elements tooltips

Hi. I have this piece of code

Rect mw;

public void Start()
{
    mw = new Rect(10, 10, 300, 300);
}

void func(int id)
{
    GUILayout.Button(new GUIContent("A", "B"));
}

public void OnGUI()
{
    mw = GUILayout.Window(10, mw, func, "aaa");
    GUI.Label(new Rect(20, 100, 50, 50), GUI.tooltip);
}

this should display a tooltip when the cursor hovers on the button. now, this code does not work. the tooltip is not displayed. it works if i move the GUI.Label instruction inside func function, but this forces me to display the tooltip inside the window and it is not a feasible solution. it seems GUI.tooltip is not updated if the update occurs inside the window. any ideas?

more ▼

asked Sep 10 '10 at 03:29 PM

Patrik gravatar image

Patrik
59 13 13 20

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3680
x201
x53

asked: Sep 10 '10 at 03:29 PM

Seen: 742 times

Last Updated: Sep 10 '10 at 03:29 PM