Skip to content

Commit 1fc23c0

Browse files
committed
Modified the CEF uncovering logic to test for R2016b (instead of R2017a)
Also, made more future-proof by transitioning to a switch-statement structure.
1 parent 54a1d0b commit 1fc23c0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

mlapptools.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ function fontColor(uielement, newcolor)
6161
tic
6262
while true && (toc < mlapptools.TIMEOUT)
6363
try
64-
% Add check for container change in R2017a (version 9.2)
65-
if verLessThan('matlab', '9.2')
66-
win = struct(struct(uifigurewindow).Controller).Container.CEF;
67-
else
68-
win = struct(struct(struct(uifigurewindow).Controller).PlatformHost).CEF;
64+
hController = struct(struct(uifigurewindow).Controller);
65+
% Check for Controller version:
66+
switch subsref(ver('matlab'), substruct('.','Version'))
67+
case '9.0' % R2016a
68+
win = hController.Container.CEF;
69+
otherwise % R2016b onward
70+
win = struct(hController.PlatformHost).CEF;
6971
end
7072
break
7173
catch err

0 commit comments

Comments
 (0)