MATLAB GUI - Tool Tips are your Friends!
16 Apr 2009 Quan Quach 4 comments 2,413 views
Tool Tips are something that is often overlooked in building a GUI. These handy descriptions can come in quite handy in almost all situations as they provide extra information.
Contents
- What is a Tool Tip?
- How to Add Tool Tips
- Adding Tool Tips Programmatically
- Download the Source Files and Other Linkss
What is a Tool Tip?
A tool tip is supplementary information about a GUI component that appears when the user hovers the mouse cursor over the GUI component. As you can imagine, this can be quite useful for the user. See below for examples.
- Tool Tip for the add button:

- Tool tip for the first input parameter:

- Tool tip for the second input parameter:

How to Add Tool Tips
Within the GUIDE editor, you can add a tool tip by modifying the “TooltipString” property using the Property Inspector. Simply double click on the component to bring up the Property Inspector. The image below shows that the “TooltipString” property has been modified for the Add! button.

Adding Tool Tips Programmatically
If you would rather add the tool tips within your code, you can use the SET command. For instance, if you wanted to add a tool tip for the add button, you could do the following in the opening function of the GUI:
%put this code into the opening function of the GUI set(handles.input1_editText,'TooltipString','This is the first input.') set(handles.input2_editText,'TooltipString','This is the second input.') set(handles.add_pushbutton,'TooltipString','This is a tool tip! Press to add.')
If you have a large list of tooltips, you may want to do it in separate m-file and call that m-file in the opening function.
Download the Source Files and Other Links
Download the source files here.
Yair’s Undocumented Tips on How to Spice up Tooltips
4 Responses to “MATLAB GUI - Tool Tips are your Friends!”
Leave a Reply
Include MATLAB code in your comment by doing the following:
<pre lang="MATLAB">
%insert code here
</pre>


Thanks, that really helped me.
[...] one of their latest posts, BlinkDagger described how to use tooltips in Matlab GUI. In one of this blog’s very first [...]
Hi,
I wanted to give multiple line tool tip …… any ideas how can i do it … ?
set(handles.start,’TooltipString’,sprintf(’%s \n’,'the’, ‘button’));