Silverfrost Forums

Welcome to our forums

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

23 Sep 2023 1:04 #30602

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

23 Sep 2023 5:53 #30604

%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.

23 Sep 2023 12:55 #30610

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

23 Sep 2023 2:31 #30611

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@.

23 Sep 2023 7:30 #30612

Thanks, Paul! I appreciate the information.

Bill

Please login to reply.