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 

Child Window in %ps can't return a value

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 663
Location: Morrison, CO, USA

PostPosted: Wed Nov 06, 2019 12:20 am    Post subject: Child Window in %ps can't return a value Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Nov 06, 2019 12:08 pm    Post subject: Reply with quote

Bill

Can you provide a simple sample so that I can trace what is happening to the return values?
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 663
Location: Morrison, CO, USA

PostPosted: Wed Nov 06, 2019 3:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Nov 06, 2019 4:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 663
Location: Morrison, CO, USA

PostPosted: Thu Nov 07, 2019 3:09 am    Post subject: Reply with quote

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

Looking forward to that release!

Bill
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ 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