View Bug Report
SimpleScrollList - Scroll Window Problem
Bug #: 39
File: LibSimpleWidgets
Date: 01-15-13 08:22 AM
By: Bullarky
Status: Fixed
dOxxx, first let me thank you for this tremendous library and for the addition of SimpleScrollList. However, there is an issue when working with small lists. When initialized the scroll window stays the exact same size. Meaning if you have three items in the list, the object in the background keeping track of visible items remains only 3 items. This is easy to reproduce, but I've included the code I'm using to see if it something I'm missing.

What happens is the list is displayed with the original three items. When you add an item, it is added to the list, but the control does not recognize it. Add another item and now the first and last item are not recognized. The background controller only recognizes three items at a time. If you run the same code again and put in 5 items to start with, the control only ever recognizes 5 items. So I'm thinking that it is an issue with the background controller.

Another oddity I've noticed with small list is that sometimes when you do a reloadui, the object loses track of all items in the list.

Again thank you for the project!

Code:
local TestUI = UI.CreateContext("TestUI")
local TestFrame = UI.CreateFrame("SimpleWindow", "TestWindow", TestUI)
local TestList = UI.CreateFrame("SimpleScrollList", "TestList", TestFrame)
local TestButton = UI.CreateFrame("RiftButton", "TestButton", TestFrame)

scrollitems = {'test1', 'test2', 'test3',}

TestFrame:SetVisible(false)
TestFrame:SetCloseButtonVisible(true)
TestFrame:SetTitle("Tester")
TestFrame:SetHeight(600)
TestFrame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 300, 100)
TestFrame:SetVisible(true)

TestList:SetBorder(1, 1, 1, 1, 1)
TestList:SetBackgroundColor(0, 0, 0, 1)
TestList:SetPoint("TOPLEFT", TestFrame:GetContent(), "TOPLEFT", 5, 60)
TestList:SetPoint("BOTTOMRIGHT", TestFrame:GetContent(), "BOTTOMRIGHT", -5, -35)
TestList:SetItems(scrollitems)

TestButton:SetText("Add Item")
TestButton:SetPoint("BOTTOMRIGHT", TestFrame, "BOTTOMRIGHT", -5, -5)
TestButton.Event.LeftClick = function() AddItem() end

function AddItem()
	local randomNo = math.random(1000)
	local newitem = string.format("test%s", randomNo)
	table.insert(scrollitems, newitem)
	TestList:SetItems(scrollitems)
end

RSS 2.0 Feed for Bug CommentsNotes Sort Options
By: doxxx - 01-15-13 12:02 PM
I'll take a look this evening. Thanks for the test code, it's much appreciated!
 
Menu
» Home



Stats
Files: 2
Downloads: 10,745
Favorites: 13

New & Updated


Riftui