Silverfrost Forums

Welcome to our forums

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

24 Oct 2011 9:28 #9124

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):

[color=green:cd90d43da4]

  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&amp;',5.0D0,3.0D0) i=winio@('%25rs&','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&amp;',5.0D0,5.0D0) i=winio@('%25rs&','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
[/color:cd90d43da4]

25 Oct 2011 7:20 #9126

Look up %lw and the control that goes with it.

Please login to reply.