The question is somewhat related to the other question I just posted in this forum.
I have a program that opens a window. In that window are a number of controls. One of them is a button which, when clicked, opens a second window elsewhere on the screen, that also has a number of controls of its own.
I've noticed that, after the second window is open, I can no longer access any of the controls in the first window, I can only use the controls in the second window. Not until I close the second window, does the first window 'come alive' again and I can use its controls.
Is there a way I can use the controls in BOTH windows, while both are open?
This short program illustrates what I mean:
[color=green:895fcd4a80]
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@('%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&',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:895fcd4a80]