Silverfrost Forums

Welcome to our forums

Child Window in %ps can't return a value

5 Nov 2019 11:20 #24629

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

6 Nov 2019 11:08 #24630

Bill

Can you provide a simple sample so that I can trace what is happening to the return values?

6 Nov 2019 2:16 #24631

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.

	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
6 Nov 2019 3:22 #24632

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.

7 Nov 2019 2:09 #24634

Thanks, Paul. In the mean time, I have other methods in place.

Looking forward to that release!

Bill

Please login to reply.