How to add mouseover in GUI

I have created a GUI using guide, there are multiple pushbuttons in the GUI.
If i put my mouse pointer over the any pushbutton in GUI, then it has to display description in small box about that pushbutton.
Is it possible to add mouseover message for each pushbutton in GUI.
Please any one suggest me how to do this.
Thanks in advance.

Respuestas (1)

Jan
Jan el 8 de Jul. de 2013
Editada: Jan el 8 de Jul. de 2013

7 votos

Do you know the 'TooltipString' property already?
figure
uicontrol('Style', 'Pushbutton', 'String', 'Hello', ...
'TooltipString', ['This is the Tooltip string!', char(10), ...
'And a 2nd line also.']);

3 comentarios

Chandra Shekhar
Chandra Shekhar el 8 de Jul. de 2013
Editada: Chandra Shekhar el 8 de Jul. de 2013
Thanks for giving answer Mr. Jan Simon,
I got the simple way of displaying mouseover event. this is the code i used
s = sprintf('Button tooltip line 1\nButton tooltip line 2');
set(handles.pushbutton1,'TooltipString',s)
Jan
Jan el 8 de Jul. de 2013
And this looks fine. Using SPRINTF('\n') is equivalent to inserting the CHAR(10) manually. Does it work as expected and is the problem solved now?
How do you do this for a button created in appdesigner? It looks like appdesigner buttons dont have Tooltipstring property:
set(app.buttonGetFile,'TooltipString','This is the mouseover string')
Error using matlab.ui.control.Button/set
There is no TooltipString property on the Button class.

Iniciar sesión para comentar.

Categorías

Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 8 de Jul. de 2013

Comentada:

el 16 de Mzo. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by