List tweak example where list's views are generated by a function

4 views
Skip to first unread message

Jeff Mather

unread,
Jun 22, 2017, 3:17:26 AM6/22/17
to macroid
Hi, could you give me (or point me to) an example of a list of widgets being tweaked as a batch, where the widgets are (say) copies of the same button which have been created by a generator function, instead of their slots being individually named as fields in their parent activity?  I am having severe difficulty determining how to the do the wiring in the case where the widgets are generated copies.  None of the variations I've tried have produced any success.

So, instead of 

List(button1, button2) <~ show

The case I'm asking about is more like

def createButton(): ImageButton = {...}
val buttons
= ListBuffer[ImageButton]()
for (i <- 1 to 10) buttons += createButton()
buttons
.toList <~ show


Thanks for any help you can provide.
Reply all
Reply to author
Forward
0 new messages