Skip to content

Commit 635c59c

Browse files
committed
Add version specific web window getter
The uifigurewindow container has changed in R2017a, requiring a new path to the underlying webwindow object. A simple MATLAB version check has been added to apply the appropriate getter Closes #2
1 parent 74ce1e5 commit 635c59c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mlapptools.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ function fontColor(uielement, newcolor)
5656
tic
5757
while true && (toc < mlapptools.querytimeout)
5858
try
59-
win = struct(struct(uifigurewindow).Controller).Container.CEF;
59+
% Add check for container change in R2017a (version 9.2)
60+
if verLessThan('matlab', '9.2')
61+
win = struct(struct(uifigurewindow).Controller).Container.CEF;
62+
else
63+
win = struct(struct(struct(uifigurewindow).Controller).PlatformHost).CEF;
64+
end
6065
break
6166
catch err
6267
if strcmp(err.identifier, 'MATLAB:nonExistentField')

0 commit comments

Comments
 (0)