question

Martin K5 avatar image
0 Likes"
Martin K5 asked Jason Lightfoot commented

How to refresh GUI window?

Hi,

I have a model with custom GUI, where I have a reference to GlobalTable. Through this GUI I am able to change GlobalTable's cell color based on value change. This is done without a problem, the cell's color changes, but the visual part is not affected. Even if I press the F5 to refresh the GUI. What I have to do is to save the model and then press the F5 button and the color changes.


Is there any command to do this as it is for combobox (refreshcombobox)?


Thank you,


Martin

FlexSim 23.1.0
color changecustom guiusing codecombobox
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jonah K avatar image
3 Likes"
Jonah K answered Jason Lightfoot commented

The main problem is that you are changing the FlexScript code then are not building it. When you change a treenode that has FlexScript data, you must then Build the Node FlexScript or Build All FlexScript in order for your changes to be complied. (This is done when you hit Save) You can add a Build FlexScript button to your toolbar in Global Preferences > Customize Toolbar, or you can right click on a treenode and select Build > Build Node FlexScript. But I'd recommend that you use the buildnodeflexscript() command. I ran this script which uses that command and I referenced the Col2Units node in the GUI, and the cell changed to the correct color in "bgColor" whenever I ran the script.

  1. buildnodeflexscript(Model.find("MODEL:/Tools/GUIs/test/table2>style/FS_CELL_FORMATTING/Col2Units"));
  2. Object gui = Model.find("MODEL:/Tools/GUIs/test");
  3. refreshview(gui);


· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.