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 

Multiple call back ('+') issue

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



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

PostPosted: Tue Jun 02, 2020 2:55 am    Post subject: Multiple call back ('+') issue Reply with quote

I have a control that, depending on value, is supposed to change the color of the control. However, when I used the "+" to get two call backs (one for color, one for an alternate action), the color would not change. The following code segment illustrates this.

In the second %rd control (two callbacks), when the callback function abcd() is executed, the clearwin_info@('CURRENT_CONTROL') now returns a control handle of zero. It matters not which of abcd() or efgh() is first. Both have the same result.

Code:

   winapp
    program main
    use mswin
    integer,external:: abcd,efgh
    integer:: i_xx=0,i_yy=10,i_zz=20
    integer:: i,j,k
    i = winio@('%wd loc(i_xx)  %wd loc(i_yy)%ff%nl&',loc(i_xx),loc(i_yy))
    i = winio@('Changes Color %^rd%ff%nl&',i_xx,abcd)
    i = winio@('No color changing %^rd',i_yy,'+',abcd,efgh)
    end
    integer function abcd()
    use mswin
    integer:: user_data,control_handle
    logical:: color_change=.false.
    abcd = 1
   USER_DATA = CLEARWIN_INFO@('LATEST_VARIABLE')
   CONTROL_HANDLE = CLEARWIN_INFO@('CURRENT_CONTROL')
    print *,'In abcd(), variable at ',user_data,' control handle ',control_handle
   if(color_change) then
         CALL SET_control_BACK_COLOUR@(CONTROL_HANDLE,RGB@(255,255,255)) ! white (normal)
   else
         CALL SET_control_BACK_COLOUR@(CONTROL_HANDLE,RGB@(255,255,0)) ! Yellow
    endif
   color_change = .not.color_change
    return
    end
    integer function efgh()
    efgh = 1
    return
    end
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Tue Jun 02, 2020 8:01 am    Post subject: Reply with quote

The simplest way to resolve this kind of issue is to insert print statements into the callbacks in order to determine if and when they are called and in which order.
Back to top
View user's profile Send private message AIM Address
wahorger



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

PostPosted: Tue Jun 02, 2020 8:41 pm    Post subject: Reply with quote

Paul, as I said, it makes no difference the order of the 2 callbacks. clearwin_info@('CURRENT_CONTROL') returns a handle of zero.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Jun 03, 2020 8:23 am    Post subject: Reply with quote

Bill

How important is this? I am guessing that it won't be easy to fix.
Back to top
View user's profile Send private message AIM Address
wahorger



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

PostPosted: Wed Jun 03, 2020 12:49 pm    Post subject: Reply with quote

Paul,

I hear you.

I have a "workaround", so while it would be a "great to have", I can deal with it other ways. Having the %ud available to both callbacks helps!

I would suggest that if it is in the "too hard to do" or "it breaks ..." category, just having it documented would be helpful. And, perhaps it can go on the "to-do" list then.

Bill
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Jun 03, 2020 3:31 pm    Post subject: Reply with quote

I will take a look when I get a minute but I am not hopeful.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Thu Jun 04, 2020 4:17 pm    Post subject: Reply with quote

This has now been fixed for the next release of the DLLs.
Back to top
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1451
Location: Aerospace Valley

PostPosted: Sat Jun 13, 2020 7:20 pm    Post subject: Reply with quote

.... and in one fell swoop 24 hours and 46 minutes later the code-meister destroys (in a very positive way) the perception by others of his own self-assessment of his own problem-solving rapid assessment capabilities ! Wink lol
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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