Add Tooltip to each UI Tree Checkbox in App Designer

63 views (last 30 days)
In App Desinger I want to add tooltips to each ui tree checkbox, so here each checkbox shall tell the user more of what is done or checked with the check exactly. Example: For "Block Colors" a tooltip might show something like "Checks if each Simulink Block has its dedicated color as defined by the company guidelines". Is there an option, as I can only find to add a tooltip to the parent CheckBoxTree but not each individual checkbox? Thank you.

Accepted Answer

Yair Altman
Yair Altman on 22 Nov 2025 at 19:31
I am not aware of any easy way to do this in the new web-figures. In the old Java-based figures it was easy to attach user-defined mouse-move callbacks that would update the control's tooltip (see this oldie for example), but the new UI makes it much more difficult.
I can think of 2 sub-optimal workarounds:
  1. Use Javascript code to implement the dynamic tooltip behavior. Alas, attaching JS code to Matlab UI is not an easy task at all (it should be, but MW for reasons unknown chose not to expose this UI-JS interface to end-users like us).
  2. Implement a user-defined SelectionChangedFcn callback, such that when the user clicks on any tree node, the tree's Tooltip property is updated based on the updated SelectedNodes property. This is certainly less useful than a dynamic mouse-hover tooltip, but at least better than nothing.
Perhaps someone finds an easier solution, I'd be happy to hear. I haven't found one [yet], and I don't know if any such easier solution even exists.
  4 Comments
Ravindra Goyal
Ravindra Goyal on 24 Nov 2025 at 7:49
Edited: Ravindra Goyal on 24 Nov 2025 at 7:49
Thank you guys for your quick feedback! Yair, I've studied your books back and forth in Uni when still building with GUIDE, now with App Designer I am getting back to the roots it seems. Thank you also dpb for your comments and the idea for custom callbacks! I guess I can not go down the road, as customer money is too tight for multiday attempts I feel... (but will try a few hours if spared :)
dpb
dpb on 24 Nov 2025 at 13:23
Edited: dpb on 24 Nov 2025 at 14:02
It's a pretty steep learning curve, for sure, it appears, particularly as (per too often usual) the examples provided are essentially trivial rather than really extending or creating new behavior.
It does look as though the classes are in m-code, however; I think if I were to really try to do something this sophisticated I would make a local copy of the base creator code and see about extending it directly rather than futzing around with the AppDesigner framework.
But, having spent 30+ yr in the consulting gig, I understand all too well the time constraints funding places on what one would like to do versus what one can afford to spend the time doing.

Sign in to comment.

More Answers (2)

dpb
dpb on 21 Nov 2025 at 17:05
No, the 'Tooltip' property is a member of only the uitree object; the children of the tree do not have such.
Seems like a reasonable enhancement request, but no way to do it at present. There aren't any callbacks defined, either, so using one of those to display some text in a 'Tag' doesn't work, either. I did not explore whether one can use 'addlistener' to the nodes or not.

Image Analyst
Image Analyst on 21 Nov 2025 at 17:14
Edited: Image Analyst on 22 Nov 2025 at 23:25
  1 Comment
dpb
dpb on 21 Nov 2025 at 17:39
Edited: dpb on 21 Nov 2025 at 20:00
While Yair is certainly the preminent whizard, I'm afraid most of his firepower for this sort of thing has been neutered by Mathworks in R2025 unless one also loads the JVM that isn't done any more by default. If go that route, then would revert to using prior SWING controls instead of the new MATLAB-supplied ui-replacements.
Would love be be shown my assumptions are in error... <vbg>
Here's <link to Yair's answer> to a thread a couple of years ago about relevance of his Java enhancements book that kinda' outlines where heading was then -- with R2025 Mathworks did finally take the plunge.

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!