Skip to content

Commit 46cec70

Browse files
committed
General fixes
- Ignoring hidden figures (that don't have Controllers) when trying to convert hWebwindow -> hUIFigure. - Corrected call to waitTillFigureLoaded. - Improved unfinished warning message.
1 parent 2bd87fc commit 46cec70

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

mlapptools.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ function textAlign(uiElement, alignment)
340340
hFigs = findall(groot, 'Type', 'figure');
341341
warnState = mlapptools.toggleWarnings('off');
342342
hUIFigs = hFigs(arrayfun(@(x)isstruct(struct(x).ControllerInfo), hFigs));
343+
hUIFigs = hUIFigs(strcmp({hUIFigs.Visible},'on')); % Hidden figures are ignored
343344
ww = arrayfun(@mlapptools.getWebWindow, hUIFigs);
344345
warning(warnState); % Restore warning state
345346
hFig = hFigs(hWebwindow == ww);
@@ -348,12 +349,12 @@ function textAlign(uiElement, alignment)
348349
function [widgetID] = getWidgetID(win, data_tag)
349350
widgetquerystr = sprintf('dojo.getAttr(dojo.query("[data-tag^=''%s''] > div")[0], "widgetid")', data_tag);
350351
hFig = mlapptools.figFromWebwindow(win);
351-
mlapptools.waitTillFigureLoaded(win, hFig);
352+
mlapptools.waitTillFigureLoaded(hFig);
352353
try % should work for most UI objects
353354
widgetID = win.executeJS(widgetquerystr);
354355
widgetID = widgetID(2:end-1);
355356
catch % fallback for problematic objects
356-
warning('Problematic control encountered with no fallback implemented yet. Please ')
357+
warning('Problematic control encountered with no fallback implemented yet.')
357358
% TODO
358359
end
359360
end % getWidgetID

0 commit comments

Comments
 (0)