The simplest way is to update the variable in a loop inside the push button callback and put inside the loop a ProcessSystemEvents () function to let the program execute toggle button callback.
A second, more elegant way in my opinion, is to use a timer set to the desired rate and put the algorithm to increment the variable inside the timer callback: the push button callback sets the ATTR_ENABLED attribute of the timer to 1, thus starting the 'ramp'; while the timer is not executing there is time for the program to proceed other tasks such as toggle button callback to stop the ramp or other control's callback.
A problem common to both the solutions is that if other tasks are time consuming, you cannot guarantee the regular rate of increment of the variable
; if this is a seriuos problem for you, you must go to other scenarios such as multithreading or multimedia timers.
Roberto