Hi folks,
I’ve been experimenting with DirectScrolledLists heavily but besides two scroll buttons and one shown button I haven’t been able to produce anything useful.
Unfortunatly the manual does not provide a working example - to be true, I haven’t even found out how a direct scrolled list should look like properly. Arg… I imagine/hope that I’ll get a vertical or horizontal list of buttons/labels/… (whatever) with the option to scroll left/right (up/down) if there are more entries than space to show the GUI elements…
What I’m able to produce is: a working directscrolledlist which has e.g. 3 buttons or labels - but only one is shown.
I paste my last confused tryout - maybe someone can give me a pointer… You can see I tried out a lot of things (e.g. forcedHeight) to get the idea…
Andrew
b1 = DirectButton(
text = ("Button1", "click!", "roll", "disabled"),
scale=0.1,
relief=2)
b2 = DirectButton(
text = ("Button2", "click!", "roll", "disabled"),
scale=0.1,
relief=2)
l1 = DirectLabel(text = "Test1", scale=0.1)
l2 = DirectLabel(text = "Test2", scale=0.1)
l3 = DirectLabel(text = "Test3", scale=0.1)
myScrolledList = DirectScrolledList(incButton_pos= (0.25,0,0.52),
incButton_text = "Inc",
incButton_scale = 0.08,
decButton_pos= (0.25,0,-0.04),
decButton_text = "Dec",
decButton_scale = 0.08,
forceHeight=3, items = [b1,b2],
numItemsVisible=1 )
#l1 = myScrolledList.itemMakeFunction("label1")
myScrolledList.addItem(l1)
myScrolledList.addItem(l2)
myScrolledList.addItem(l3)
l1.setPos(0,0,0.1)
l2.setPos(0,0,0.3)
l3.setPos(0,0,0.5)
myScrolledList.refresh()
#l1.hide()
#l2.hide()
#l3.hide()
#myScrolledList['text'] = "MyScrolledList"
#myScrolledList['text_scale'] = 0.2
myScrolledList['frameSize'] = (-0.1, 0.6, -0.1, 0.6)
myScrolledList['frameColor'] = (1,0,0,0.5)
myScrolledList.itemFrame['frameSize'] = (0, 0.5, 0, 0.5)
#myScrolledList.incButton['frameSize'] = (0, 0.1, 0, 0.1)
#myScrolledList.decButton['frameSize'] = (0, 0.1, 0, 0.1)
myScrolledList.incButton['text_scale'] = .5
myScrolledList.decButton['text_scale'] = .5
myScrolledList.setPos(-1,0,0)
pdir(myScrolledList.itemFrame)
myScrolledList.itemFrame.resetFrameSize()
myScrolledList.resetFrameSize()