replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - If button in one window opens second window, can I close 1st
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 

If button in one window opens second window, can I close 1st

 
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: Mon Oct 24, 2011 10:28 pm    Post subject: If button in one window opens second window, can I close 1st Reply with quote

I've written a program (FTN95) on a Windows XP system, that opens a window. In that window are several buttons, one of which opens a second window elsewhere on the screen. Both windows stay open.

Presently, I can (later) close that second window by clicking the red X in the upper right corner, and the first window stays open after I close the second.

Can I also put together a capability where, after I open the second window, I can close the FIRST window by clicking its red X, and this causes both the first and second windows to immediately close at the same time?

This short program illustrates what i mean (I hope):



PROGRAM MyMainProg
WINAPP
INCLUDE <windows.ins>
C**********************************************************************

CALL OpenFirstWin

STOP
END
C
C
SUBROUTINE OpenFirstWin()
INTEGER Open2ndWinCallbk
EXTERNAL Open2ndWinCallbk
C* Position the First Window on screen.
i=winio@('%sp&',20,20)
C* Create the First Window.
i=winio@('%ca[This is the first window]&')
C
C* Put short description in First Window.
i=winio@('%`ap&',5.0D0,3.0D0)
i=winio@('%25`rs&',"Short Descr. inside First Window")
C* Put "Open Second Window" button
i=winio@('%`ap&',10.0D0,8.0D0)
C* No ampersand so that first window opens after this statement.
i=winio@('%^bt[Open Second Window]',Open2ndWinCallbk)

RETURN
END
C
C
INTEGER FUNCTION Open2ndWinCallbk()
INTEGER DoNothingCallBk
DOUBLE PRECISION DX,DY
EXTERNAL DoNothingCallBk
C
C* Position the Second Window somewhere else on screen.
DX=RANDOM@()*500.0+100.0
DY=RANDOM@()*400.0+100.0
IX=DX
IY=DY
i=winio@('%sp&',IX,IY)
C* Create the Second Window.
i=winio@('%ca[This is the Second Window]&')
C
C* Put short description.
i=winio@('%`ap&',5.0D0,5.0D0)
i=winio@('%25`rs&',"Short Descr. inside 2nd Win")
C* Put small "Do Nothing" button
i=winio@('%`ap&',10.0D0,12.0D0)
C* No ampersand so that second window opens after this statement.
i=winio@('%^bt[This Button Does Nothing]',DoNothingCallBk)
Open2ndWinCallbk=1
END
C
C
INTEGER FUNCTION DoNothingCallbk()
C
DoNothingCallbk=1
END
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Oct 25, 2011 8:20 am    Post subject: Reply with quote

Look up %lw and the control that goes with it.
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