-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't format uitreenode text #6
Comments
Will have to do some deeper investigation, I cannot reproduce this on my machine. |
Matlab 2017b -- should have mentioned that. Have not tried it on other versions. |
@davidn-IA OS ? |
W10 Enterprise FCU |
Ok, I can reproduce this. Let's see now.... For now I found a totally unrelated bug in |
Previous logic assumed that the parent of the input UI object is the UI Figure, which is an incorrect assumption. Other containers, like uipanel, exist and are valid parents for other UI objects but will cause the object type check to fail. This type check has been updated to utilize ancestor to obtain the parent figure window. See #6
Good news - I found a way to format It seems that I had to rethink how we uniquely identify (and pass around) UI objects. This resulted in some refactoring an overall more robust code. @davidn-IA Until the latest PR is merged, you can head over to my fork and give the new code a try! |
Fantastic, thanks. Will be checking it out shortly. |
It's an improvement but unfortunately fails on subnodes, per this example: f = uifigure('Position', [680 558 560 420]); |
Changed this from 'bug' to 'enhancement' because formatting trees seems to require a completely different approach than other widgets. At the moment, only top-level tree nodes can be modified permanently, whereas sub-nodes must be visible (i.e. parent is expanded) to apply changes, and changed don't persist if the parent node is collapsed. function Issue6
f = uifigure('Position', [680 558 560 420]);
t = uitree(f,'Position',[20 20 520 380]);
tn = uitreenode(t,'Text','Lorem');
tn2 = uitreenode(tn,'Text','Ipsum');
tn3 = uitreenode(tn2,'Text','Dolor');
mlapptools.fontWeight(tn3, 'bold');
end |
Should be fixed with #8 (947c54e). @davidn-IA, how does it look on your end? |
Fantastic. This is a terrific improvement, thanks! |
@sco1 I wouldn't close it just yet seeing how the existing solution is not really ideal... |
Submitted pull request #5 allows formatting controls whose parent is not the uifigure, however, the following fails:
f = uifigure('Position', [680 558 560 420]);
t = uitree(f,'Position',[20 20 520 380]);
tn = uitreenode(t,'Text','Test me');
mlapptools.fontWeight(tn, 'bold');
with the following error:
Error using mlapptools/getWidgetID (line 363)
widgetID query timed out after 5 seconds, UI needs more time to load
Error in mlapptools.getWebElements (line 108)
widgetID = mlapptools.getWidgetID(win, mlapptools.getDataTag(uiElement));
Error in mlapptools.fontWeight (line 65)
[win, widgetID] = mlapptools.getWebElements(uiElement);
Error in Untitled4 (line 6)
mlapptools.fontWeight(tn, 'bold');
(Note that increasing timeout doesn't help)
The text was updated successfully, but these errors were encountered: