Context: I want have a workspace set up with a number of dashboard windows each of which will be exported to a .png. Then switch into that workspace and run that export using one user command. The desired result:
Problem: after I switch to another workspace using
treenode screenshots_workspace = Model.find("Tools/Workspaces/screenshots"); applicationcommand("openworkspace", screenshots_workspace, 1);
the dashboard windows don't manage to paint the contents of their graphs before the consequent exports to .pngs take place:
treenode view_node = views().find("active/DockingGUI"); string filePath = modeldir() + "test.png"; viewtofile(view_node, filePath);
and that results in exporting screenshots with empty graphs:
I tried the following ways of forcing the paint instruction to execute before the exports:
repaintall(); repaintview(view_node); msg("", "Desperate attempt at giving the paint instruction more time to execute.");
However, none of them worked.
Any ideas how to resolve this problem? I am attaching a model that recreates this issue.