x


Tooltips in a window

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(330, Screen.height - Input.mousePosition.y, 300, 50), GUI.tooltip);
}

the logic is simple: display a window with a button and show a tooltip when the mouse hovers over the button. of course it doesn't work. what am I missing?

what happens: the window and the button inside it are displayed.

what doesn't happen: the tooltip is not shown when i hover over the button

more ▼

asked Sep 07 '10 at 08:39 AM

Patrik gravatar image

Patrik
59 13 13 20

"It doesn't work" is not helpful in the least bit. How about explaining exactly what happens and doesn't happen so we can help you better?

Sep 07 '10 at 10:04 AM qJake

what happens: the window and the button inside it are displayed. what doesn't happen: the tooltip is not shown when i hover over the button

Sep 07 '10 at 10:58 AM Patrik
(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:

x3816
x208
x56

asked: Sep 07 '10 at 08:39 AM

Seen: 1080 times

Last Updated: Sep 08 '10 at 03:18 PM