replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - How to make other windows close when I close the main window
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to make other windows close when I close the main window

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Little-Acorn



Joined: 06 Jul 2008
Posts: 111
Location: San Diego

PostPosted: Wed Nov 26, 2008 2:49 am    Post subject: How to make other windows close when I close the main window Reply with quote

I'm running a program that puts up a "main" window (just my name for it), and then depending on what the rest of the program wants to do, puts up several other windows in other parts of the screen (not inside the main window). All of them work fine.

But when I go to the main window and click the little X in the upper right corner, that main window closes as expected, but the others don't. I wish they did. Now I have to close each of them manually, by clicking their little X's too.

How can I get those other windows to close automatically, when I click on (only) the little X in the main window?

Thanks again, all!
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2615
Location: Sydney

PostPosted: Wed Nov 26, 2008 3:41 am    Post subject: Reply with quote

see support > closing graphics windows, 1 Nov 08.

Paul Laidler gave an example which works well, if you know the window "name".
I guess you would test to see if you could get a handle for the possible window names that are open and then close them as they are found.

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Wed Nov 26, 2008 8:09 am    Post subject: Reply with quote

If your windows are ClearWin+ windows then the trick is to use %lw for each secondary window and to programmatically set the associated control variables when you want them to close. You will find details in the help file.
Back to top
View user's profile Send private message AIM Address
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Wed Nov 26, 2008 9:08 am    Post subject: Reply with quote

To do what Paul has suggested you'll first have to intercept the action of the user clicking on the little "x", using %cc to invoke a call back routine which can then run through the closure of all the windows which have made use of %lw.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Wed Nov 26, 2008 9:46 am    Post subject: Reply with quote

Or you can create a main window without %lw and then the last winio@ (of the main window) will not return until the window is closed. At that point you can set the %lw control variables for the other secondary windows.

I guess you will also have to call window_update@ for each control variable.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group