View Single Post
04-22-24, 05:08 PM   #1
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 324
How to track the scroll position of a WowScrollBoxList

I would like my addon to keep track of the current scroll position of the achievements frame scroll box.
But the scroll box only seems to have an OnMouseWheel script.

Lua Code:
  1. AchievementFrameAchievements.ScrollBox:HookScript("OnMouseWheel", function(self)
  2.   print(AchievementFrameAchievements.ScrollBox.scrollPercentage)
  3. end)

The same goes for its scroll bar.

Lua Code:
  1. AchievementFrameAchievements.ScrollBar:HookScript("OnMouseWheel", function(self)
  2.   print(AchievementFrameAchievements.ScrollBox.scrollPercentage)
  3. end)

But what if the user changes the scroll position dragging the scroll bar or clicking the scroll bar steppers?
Are there scripts to hook as well?

Is there not an easier way? Like a scroll frames' OnVerticalScroll script?
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote