View previous topic :: View next topic |
Author |
Message |
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Wed Nov 06, 2019 12:20 am Post subject: Child Window in %ps can't return a value |
|
|
I had a window built with two child windows and using %ps. One child window included a button that returns a negative number. The intent was to close the parent window and return the value to the calling program as a value with which to take an action.
While the parent window closes, the value reported as the return value was zero, not expected. I have scanned the documentation, but there is no reference to this return of a zero value in this situation. I know that buttons defined in the parent window will return the appropriate value. But, apparently, not from a child.
Is my "analysis" correct?
Bill |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Nov 06, 2019 12:08 pm Post subject: |
|
|
Bill
Can you provide a simple sample so that I can trace what is happening to the return values? |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Wed Nov 06, 2019 3:16 pm Post subject: |
|
|
Here's the code sample. Pressing the button in the tab should return a non-zero value that is the number of the tab. The third button is for completeness.
Code: | winapp
integer sheet(2)
integer i
integer,external:: button1,button2,button3
i = winio@('%sh%ca[Button1]%^bt[Button1]',sheet(1),button1)
i = winio@('%sh%ca[Button2]%^bt[button2]',sheet(2),button2)
i = winio@('%ww[independent,not_fixed_size]&')
i = winio@('Select the tab and press the button to get the return value%ff&')
i = winio@('This should return "3" %^bt[Button3]%ff%nl&',button3)
i = winio@('%2ps[hot_track]',sheet(1),sheet(2))
print *,'Returned value was',i
stop
end
INTEGER(KIND=7) FUNCTION BUTTON1()
BUTTON1= -1
RETURN
END
INTEGER(KIND=7) FUNCTION BUTTON2()
BUTTON2= -2
RETURN
END
INTEGER(KIND=7) FUNCTION BUTTON3()
BUTTON3= -3
RETURN
END
|
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Nov 06, 2019 4:22 pm Post subject: |
|
|
Bill
I think you are right in expecting a non-zero return value but as far as I can tell it has never worked that way for a button in a property sheet.
I can fix it in a way that is very unlikely to break any existing code so I will apply the fix for the next release of the DLLs. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu Nov 07, 2019 3:09 am Post subject: |
|
|
Thanks, Paul. In the mean time, I have other methods in place.
Looking forward to that release!
Bill |
|
Back to top |
|
|
|