ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 02-09-2012
Stephan Seidel's Avatar
Stephan Seidel Stephan Seidel is offline
Flexsim User
 
Join Date: Mar 2009
Location: Dresden, Germany
Posts: 36
Downloads: 20
Uploads: 0
Thanks: 26
Thanked 22 Times in 8 Posts
Rep Power: 150
Stephan Seidel will become famous soon enough
Arrow Closing GUI Windows correctly

Hi all,

I've created my own Model Control GUI and I open from that GUI via the OnPress Trigger of an button another GUI:

createview("MAIN:/project/model/Tools/GUIs/Testing GUI");

In that new GUI I've got a button which is supposed to close the new GUI. The code is:

closeview(ownerview(c));

The window is closed, everything appears to work well. But when I save and reopen the model all the small "Testing GUI" windows that I've ever opened and closed afterwards are open again. I can close them again and you can believe me, it takes ages to close 50 or so windows.

So here are my questions:
  1. What should the code for such a Close button look like? closeview is apparently not correct.
  2. How can I prevent the model from reopening all the windows from the past? Where is the information stored that these windows have to be reopened?

I'm also afraid there is nothing in the Documentation about that particular issue.
So thanks for any help.

Stephan
__________________
---
You can't have it both ways.
  #2  
Old 02-09-2012
Stephan Seidel's Avatar
Stephan Seidel Stephan Seidel is offline
Flexsim User
 
Join Date: Mar 2009
Location: Dresden, Germany
Posts: 36
Downloads: 20
Uploads: 0
Thanks: 26
Thanked 22 Times in 8 Posts
Rep Power: 150
Stephan Seidel will become famous soon enough
Default

Quote:
Originally Posted by Stephan Seidel View Post
2. How can I prevent the model from reopening all the windows from the past? Where is the information stored that these windows have to be reopened?
For the closing part I've found a very simple solution. I just had to click the close [x] button in the upper right corner of the window. If I close every window this way they wont reopen on reloading the model. Now the remaining question is:
What code is behind the little [x]?
__________________
---
You can't have it both ways.
  #3  
Old 02-09-2012
Carsten Seehafer's Avatar
Carsten Seehafer Carsten Seehafer is offline
FlexSim Geek
 
Join Date: Oct 2008
Location: Ritterhude, Deutschland
Posts: 230
Downloads: 45
Uploads: 1
Thanks: 474
Thanked 320 Times in 143 Posts
Rep Power: 379
Carsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud of
Default

Quote:
The view is not removed from the active views folder, however. Use destroyobject() to remove it.
This is from the documentation of closeview(). You have to add destroyobject()


Greetings

Carsten


P.S.: The "x" is from windows and not flexsim code.
The Following 3 Users Say Thank You to Carsten Seehafer For This Useful Post:
Stephan Seidel (02-09-2012)
  #4  
Old 02-09-2012
Stephan Seidel's Avatar
Stephan Seidel Stephan Seidel is offline
Flexsim User
 
Join Date: Mar 2009
Location: Dresden, Germany
Posts: 36
Downloads: 20
Uploads: 0
Thanks: 26
Thanked 22 Times in 8 Posts
Rep Power: 150
Stephan Seidel will become famous soon enough
Thumbs up Closing a custom GUI per button

Many thanks, Carsten. Especially for pointing out the documentation on closeview. Apparently I was so disappointed by it, that I didnt even bother to look.

Just to post the complete code it in case someone is looking for it:

Code:
closeview(ownerview(c));
destroyobject(ownerview(c));
Cheers,
Stephan
__________________
---
You can't have it both ways.
The Following User Says Thank You to Stephan Seidel For This Useful Post:
Carsten Seehafer (02-09-2012)


Thread Thread Starter Forum Replies Last Post
How to set dynamicaly closing node edge in a network node Preethi Sivaramakrishnan Tips and Tricks 8 06-27-2013 01:35 PM
Problem in opening and closing ports claudia gertheinrich Q&A 3 01-22-2010 02:34 AM
Keeping run speed after closing the model Lydia Franck Gripes and Goodies 4 05-06-2009 03:38 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.