Thread: Slider problems
View Single Post
09-23-13, 04:34 AM   #20
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Maybe http://wowpedia.org/API_Slider_SetStepsPerPage, http://wowpedia.org/API_Slider_GetStepsPerPage causes a sort of endless loop? That are the only changes since 5.4 for slider object.

Getting an endless loop is easy. You set a value and on value set you call a function that sets a value. O_O

What will this do for you?
Lua Code:
  1. --If steps >= 1, the Slider's value will be changed by
  2. --exactly Slider:GetValueStep()*math.floor(steps) in the
  3. --direction of the click.
  4. slider:SetStepsPerPage(0) --disable SetStepsPerPage
  5.  
  6. --[[
  7. slider.SetStepsPerPage = function(...)
  8.   print(self:GetName().." called SetStepsPerPage")
  9.   print(...)
  10. end
  11.  
  12. slider.GetStepsPerPage = function(...)
  13.   print(self:GetName().." called GetStepsPerPage")
  14.   print(...)
  15. end
  16. ]]--

If your valuestep is very low (0.001 or lower) make sure to use bigger steps like: 1/valueStep
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 09-23-13 at 04:53 AM.
  Reply With Quote