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 

Attaching user data (%ud) to a delay timer (%dl)

 
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: 1217
Location: Morrison, CO, USA

PostPosted: Sat Sep 23, 2023 2:04 am    Post subject: Attaching user data (%ud) to a delay timer (%dl) Reply with quote

Is this permitted? Stated another way, is %dl a control in the classic sense?

Wanted to ask the question before I invested a lot of time.

I tried to use clearwin_info@('USER_DATA') like I had in other cases where a control had user data attached, and it was null().

Do I have to use "CALLBACK_CONTROL" to get the handle of the control to which the user data is attached (which I did not)?

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


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

PostPosted: Sat Sep 23, 2023 6:53 am    Post subject: Reply with quote

%dl doesn't create a control. It makes a call to the Microsoft API SetTimer for the given callback function.

The internal list of ClearWin+ timers could be extended to include a user data member but I don't know off hand how that would work out when retrieving the data.
Back to top
View user's profile Send private message AIM Address
wahorger



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

PostPosted: Sat Sep 23, 2023 1:55 pm    Post subject: Reply with quote

Paul,

Thanks for confirming what I experienced when I tried to attach user data. I'm OK with simply getting the callback window handle to adjust the timer.

That said, the documentation says that a window can have multiple timers. How would one know which timer was activated, other than the callback function for the specific timer? And how would one alter the interval, or kill, a specific timer? I currently don't do anything like this, more curious than anything.

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


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

PostPosted: Sat Sep 23, 2023 3:31 pm    Post subject: Reply with quote

Bill

You can have multiple timers for a given parent window either with multiple %dl's or by adding timers at runtime. The routine SET_TIMER@ adds a new timer at runtime and KILL_TIMER@ removes a timer. KILL_TIMER@ passes the associated callback function as an argument in order to unquely identify the timer.

The routine CHANGE_TIMER_INTERVAL@ only works for the first %dl. Otherwise to change the delay it is necessary to call KILL_TIMER@ and then SET_TIMER@.
Back to top
View user's profile Send private message AIM Address
wahorger



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

PostPosted: Sat Sep 23, 2023 8:30 pm    Post subject: Reply with quote

Thanks, Paul! I appreciate the information.

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