Quantcast WoWInterface - View Single Post - Help on ScrollFrame with LUA
View Single Post
02-12-13, 02:46 PM   #16
A Pyroguard Emberseer
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,685
I finshed my test and implemented a first version into my panel.


You can even freely resize the whole panel and the scrollFrame will be cropped properly. The scrollbar adjusts properly aswell. Very nice.

All what I had to do was:

If you are fine with the default template you can even go with

Lua Code:
  1. --create a scrollframe inside
  2.     local scrollFrame = CreateFrame("ScrollFrame", "$parentScrollFrame", frame, "UIPanelScrollFrameTemplate")
  3.     scrollFrame:SetPoint("TOPLEFT")
  4.     scrollFrame:SetPoint("BOTTOMRIGHT",-22,0)
  6.     local scrollChild = CreateFrame("Frame",nil,ScrollFrame)
  7.     --scrollChild:SetWidth(scrollFrame:GetWidth()) --optional
  8.     --fill scrollchild with data and adjust size
  9.     genData(scrollChild,100)
  10.     scrollFrame:SetScrollChild(scrollChild)
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

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