Skip to content
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

Private function figFromWebwindow doesn't work on R2017a #18

Open
Proxoso opened this issue Mar 26, 2018 · 4 comments
Open

Private function figFromWebwindow doesn't work on R2017a #18

Proxoso opened this issue Mar 26, 2018 · 4 comments
Labels
version-specific For issues that only apply to a specific MATLAB version (e.g. compatibility with new releases). workaround-available Original problem still exists, but there's an alternative way to achieve the same thing w/o errors.

Comments

@Proxoso
Copy link

Proxoso commented Mar 26, 2018

Expected Behavior

   myGUI = DOMdemoGUI;
   mlapptools.fontColor(myGUI.TextArea, 'aqua');

Change color from TextArea font to 'aqua'

Actual Behavior

Error using arrayfun
matlab.internal.webwindow output type is not supported. Set 'UniformOutput' to false.

Error in mlapptools/figFromWebwindow (line 434)
            ww = arrayfun(@mlapptools.getWebWindow, hUIFigs);

Error in mlapptools/waitTillWebwindowLoaded (line 595)
              hFig = mlapptools.figFromWebwindow(hWebwindow);

Error in mlapptools.getWebElements (line 140)
            mlapptools.waitTillWebwindowLoaded(win);

Error in mlapptools.fontColor (line 69)
            [win, ID_struct] = mlapptools.getWebElements(uiElement);

If changing line 434 from:
ww = arrayfun(@mlapptools.getWebWindow, hUIFigs);
to
ww = arrayfun(@mlapptools.getWebWindow, hUIFigs, 'un',0);

following error occurs:

Error using getappdata
Value must be a handle.

Error in mlapptools/getTimeout (line 488)
            to = getappdata(hFig, mlapptools.TAG_TIMEOUT);

Error in mlapptools/waitTillWebwindowLoaded (line 598)
            to = mlapptools.getTimeout(hFig);

Error in mlapptools.getWebElements (line 140)
            mlapptools.waitTillWebwindowLoaded(win);

Error in mlapptools.fontColor (line 69)
            [win, ID_struct] = mlapptools.getWebElements(uiElement);

Steps to Reproduce the Problem

Enter this command in the Matlab Command Line (or any other command from the examples):

  myGUI = DOMdemoGUI;
  mlapptools.fontColor(myGUI.TextArea, 'aqua');

Specifications

  • MATLAB Release: R2017a
  • Operating System: Win 7
@sco1
Copy link
Member

sco1 commented Mar 26, 2018

This is likely version specific, the issue does not occur in R2017b.

@sco1 sco1 added the version-specific For issues that only apply to a specific MATLAB version (e.g. compatibility with new releases). label Mar 26, 2018
@Dev-iL
Copy link
Member

Dev-iL commented Apr 8, 2018

@Proxoso While we're adding a warning or a workaround for older versions, you can use the setStyle syntax, which should work :

myGUI = DOMdemoGUI;
[hWin, widgetID] = mlapptools.getWebElements(myGUI.TextArea);
mlapptools.setStyle(hWin, 'color', 'aqua', widgetID);

@Dev-iL Dev-iL changed the title Mlapptools doesn't work on R2017a? Private function figFromWebwindow doesn't work on R2017a Apr 8, 2018
@Dev-iL Dev-iL added the workaround-available Original problem still exists, but there's an alternative way to achieve the same thing w/o errors. label Apr 8, 2018
@altmany
Copy link

altmany commented Jul 25, 2018

@Dev-iL - if you look at the error stack provided by @Proxoso , you'll see that it stems from mlapptools.fontColor:69 -

[win, ID_struct] = mlapptools.getWebElements(uiElement);

which indicates that your suggested workaround will also fail, because getWebElements fails.

My hunch is that it's due to a slow rendering, which means the timeout is reached before the widgetID is available.

@Dev-iL
Copy link
Member

Dev-iL commented Jul 25, 2018

@altmany Good point. I have modified the waitTillWebwindowLoaded logic a bit to make getWebElements less likely to fail due to trivial problems; it might help with this issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version-specific For issues that only apply to a specific MATLAB version (e.g. compatibility with new releases). workaround-available Original problem still exists, but there's an alternative way to achieve the same thing w/o errors.
Projects
None yet
Development

No branches or pull requests

4 participants