Quantcast
WoWInterface - View Single Post - FauxScrollFrame Issues
View Single Post
05-25-20, 09:44 PM   #9
sezz
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 128
self.ScrollFrame:GetWidth() returns 0 in XrystalUI_ProfileList_OnLoad, you can use anchors instead:

Lua Code:
  1. function XrystalUI_ProfileList_OnLoad(self)
  2.     self.ScrollFrame.List = {}
  3.     self.ScrollBar = self.ScrollFrame.ScrollBar
  4.     for i = 1,16 do
  5.         self.ScrollFrame.List[i] = self:CreateFontString(nil,"OVERLAY","XrystalUI_ScrollingText")
  6.         self.ScrollFrame.List[i]:SetHeight(20)
  7.         if i == 1 then
  8.             self.ScrollFrame.List[i]:SetPoint("TOPLEFT",self.ScrollFrame,"TOPLEFT",5,-5)
  9.             self.ScrollFrame.List[i]:SetPoint("TOPRIGHT",self.ScrollFrame,"TOPRIGHT",-5,-5)
  10.         else
  11.             self.ScrollFrame.List[i]:SetPoint("TOPLEFT",self.ScrollFrame.List[i - 1],"BOTTOMLEFT")
  12.             self.ScrollFrame.List[i]:SetPoint("TOPRIGHT",self.ScrollFrame.List[i - 1],"BOTTOMRIGHT")
  13.         end
  14.         self.ScrollFrame.List[i]:SetJustifyV("TOP")
  15.         self.ScrollFrame.List[i]:SetJustifyH("LEFT")
  16.     end
  17.     self.ScrollBar:SetValue(0) -- go to top
  18.     XrystalUI_ProfileList_Update(self.ScrollFrame) -- update list
  19. end
  Reply With Quote