question

Raul V3 avatar image
0 Likes"
Raul V3 asked Raul V3 edited

Delete Items Using GUI

GUIExample.fsm

Hi team.


Im creating a GUI and I tried to use below code "onpress" but dont work, could you please let me know where i need to do the improvement?

int contenido= content(model());
for (int k = contenido; k>2; k--){
destroyobject(rank(model(),k) }


If i use the "script console" the above code works well, so I dont know why dont work.

Thanks a lot




FlexSim 20.1.3
flexsim 20.1.3gui
1596827383607.png (157.8 KiB)
guiexample.fsm (26.3 KiB)
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

·
Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Raul V3 edited

The issue is that there are 2 OnPress nodes. If you delete the first one, then it works. You might want to repaintall() afterwards, though, since the view won't paint until you click on it.

· 1
5 |100000

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

Raul V3 avatar image Raul V3 commented ·

Thanks a lot! the command repaintall() is what i need as well, thanks

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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