Comments on: Spicing up Matlab uicontrol tooltips https://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips Charting Matlab's unsupported hidden underbelly Thu, 02 May 2024 08:00:01 +0000 hourly 1 https://wordpress.org/?v=4.4.1 By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-448263 Sun, 21 Oct 2018 15:25:35 +0000 https://undocumentedmatlab.com/?p=327#comment-448263 @Konstantin – you can set up a custom cell-editor that displays a different list of drop-down/pop-up values based on certain conditions (such as the data in another column in the same row). I explain how to do this in my book Undocumented Secrets of Matlab-Java Programming or in my uitable customization report:

]]>
By: Konstantinhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-446375 Thu, 11 Oct 2018 08:18:09 +0000 https://undocumentedmatlab.com/?p=327#comment-446375 Hi Yair. Your article is excellent, but i see in column “Names” you realized different data for popup in different rows. Please, can you says how you do this?

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-332965 Wed, 01 Oct 2014 05:05:21 +0000 https://undocumentedmatlab.com/?p=327#comment-332965 @Laurent – set the TooltipString property on the toolbar icon’s handle (uipushtool, uitoggletool, uisplittool, or uitogglesplittool) – not on the toolbar handle.

]]>
By: Laurenthttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-332957 Wed, 01 Oct 2014 04:38:08 +0000 https://undocumentedmatlab.com/?p=327#comment-332957 Hi Yair ,
Thanks for the tremendous amount of good tips on this blog, it s really helpful.
i was wondering how to put tooltip on a matlab toolbar icon.
As ‘TooltipString’ is not an accessible property for an instance of class ‘uitoolbar’.

any idea how to work around this ?

Thanks,

L.

]]>
By: Kaihttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-323867 Tue, 29 Apr 2014 08:11:10 +0000 https://undocumentedmatlab.com/?p=327#comment-323867 @Yair,

The code to display tooltips programmatically does not work for uitables in newer Matlab versions anymore:

import java.awt.event.ActionEvent;
u = uitable('data',zeros(4,4),'tooltip','text...');
jScroll = findjobj(u);
jTable = jScroll.getViewport.getView;
action = jTable.getActionMap.get('postTip')

matlab output:

action =
     []
]]>
By: Nickhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-103302 Fri, 10 Aug 2012 14:16:06 +0000 https://undocumentedmatlab.com/?p=327#comment-103302 I ended up getting this working by adding the image file to the executable’s CTF archive (using the -a option to MCC) and then referencing it in my code by:

imagePath = fullfile(ctfroot,'mypic.png');

Then I provided imagePath as the path in the “img” tag. So…this was less of an HTML question, more about proper use of MCC.

]]>
By: Nickhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-103180 Thu, 09 Aug 2012 20:33:57 +0000 https://undocumentedmatlab.com/?p=327#comment-103180 Is it possible to use HTML to reference an image file from a compiled MATLAB executable? Is the format for the HTML “img” tag the same?

img src=”file:\c:/user/mypic.png” worked when running my application in MATLAB, but I think the path isn’t correct when I run from my compiled exe. (Crazy MCR!)

Also, are relative paths accepted? I could only get this to work with a full path so far.

]]>
By: Multi-line tooltips | Undocumented Matlabhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-60858 Thu, 03 Nov 2011 02:11:37 +0000 https://undocumentedmatlab.com/?p=327#comment-60858 […] In this blog, I have already posted several articles about how to tweak tooltip contents (here, here, and here). Today I would like to expand on one of the aspects that were already covered, […]

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-24647 Sat, 04 Dec 2010 18:45:38 +0000 https://undocumentedmatlab.com/?p=327#comment-24647 @Koelemay – datacursor popups are not tooltips and they don’t support HTML to the best of my knowledge. There’s probably a way to make them HTML-aware, if you dig deep enough in the datacursor code (\toolbox\matlab\graphics\@graphics\@datacursor\*.m, \@datatip\*.m and their relatives within \@graphics). Let us all know if you find a workaround.

]]>
By: Koelemayhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-24508 Fri, 03 Dec 2010 13:42:44 +0000 https://undocumentedmatlab.com/?p=327#comment-24508 Hi Yair,
Sorry I think my question was too ambiguous; I was wondering if it is possible to get html markup in the datacursor mode popups. So, for example, using datamatrix I’d like to use html markup in the strings for the dataTips input. Hopefully I’m not missing something horribly obvious! Thanks again for your help!

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-24436 Thu, 02 Dec 2010 17:11:44 +0000 https://undocumentedmatlab.com/?p=327#comment-24436 @Koelemay – take a look at my DataMatrix utility, which does this:
DataMatrix data-cursor popup

]]>
By: Koelemayhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-24425 Thu, 02 Dec 2010 15:05:01 +0000 https://undocumentedmatlab.com/?p=327#comment-24425 Great post as usual — any idea how to get this to work on the text popups when using datacursormode?? It seems like it would be similar to the tooltips but doesn’t seem to work by default. Thanks in advance for your time!

]]>
By: Zeilenumbruch für Tooltips in Matlab | House-Tiere         -d(~_~)b-https://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-9063 Sat, 17 Apr 2010 01:46:59 +0000 https://undocumentedmatlab.com/?p=327#comment-9063 […] Was aber funktioniert ist html, es gibt ein undokumentiertes Feautre, mit dem einfach html eingefügt werden kann – Java machts möglich. […]

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-1176 Wed, 03 Jun 2009 21:41:56 +0000 https://undocumentedmatlab.com/?p=327#comment-1176 @Alan – thanks.

I’ll do a post or two about systemdependent but look at my long TODO list: so little time, so much to do…

]]>
By: Alanhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-1175 Wed, 03 Jun 2009 21:19:30 +0000 https://undocumentedmatlab.com/?p=327#comment-1175 Offtopic, sorry, but just wanted to reiterate – great blog idea, you should definitely keep it up. How about a post on systemdependent() ?

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-1174 Wed, 03 Jun 2009 17:18:56 +0000 https://undocumentedmatlab.com/?p=327#comment-1174 @wei – handle2struct/struct2handle are internal Matlab functions that cannot be modified. However, you can easily build your own m-file version that try’s to call the built-in version and if an error is thrown, then the catch segment will create the necessary output object based on inspection of the Java object.

This could be a nice File Exchange submission – care to tackle it?

You can get some pointers by looking at the code within my UIInspect utility on the File Exchange.

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-1173 Wed, 03 Jun 2009 17:10:51 +0000 https://undocumentedmatlab.com/?p=327#comment-1173 @Ben – this was challenging: Until you asked I thought I knew the standard answer, which is “no” – tooltips use the system’s ToolTipManager object that can’t be modified. But then I found this Java hack, which I’m not even sure is documented in Java… Assuming you get the Java reference in jHandle:

import java.awt.event.ActionEvent;
action = jHandle.getActionMap.get('postTip');
actionEvent = ActionEvent(jHandle, ActionEvent.ACTION_PERFORMED, 'postTip');
action.actionPerformed(actionEvent);

The mouse does not even have to be anywhere near the GUI object!

Unfortunately, this hack requires the Java reference of the GUI object, and is not available for Matlab handles. To get a Matlab handle’s underlying Java reference you can use my FindJObj utility on the File Exchange and then use the hack.

]]>
By: Ben Shepherdhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-1172 Wed, 03 Jun 2009 14:39:20 +0000 https://undocumentedmatlab.com/?p=327#comment-1172 That looks like a really handy feature! On a slightly related note, do you know of any way of forcing a tooltip to display (or update one that is already being displayed)?

]]>
By: MATLAB GUI - Tool Tips are your Friends! | blinkdaggerhttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-1088 Sun, 31 May 2009 09:09:26 +0000 https://undocumentedmatlab.com/?p=327#comment-1088 […] Yair’s Undocumented Tips on How to Spice up Tooltips […]

]]>
By: weihttps://undocumentedmatlab.com/blog_old/spicing-up-matlab-uicontrol-tooltips#comment-1046 Fri, 29 May 2009 14:37:06 +0000 https://undocumentedmatlab.com/?p=327#comment-1046 Yair, Could handle2struct/struct2handle pair be extended to cover all java objects?

]]>