list_items =
[
{text: 'ほげほげ'},
{text: 'ふがふが'},
{text: 'ふー'},
{text: 'ばー'},
]
これを
labels_list_with_format(list_items)
こうするといい感じになった
def labels_list_with_format(list_items)
list_items.each do |li|
@script_list.items << label(text: li[:text])
end
end
さらに
list_items =
[
{type: button, text: 'ほげほげ', action: 'hoge'},
{type: button, text: 'ふがふが', action: 'fuga'},
{type: button, text: 'ふー', action: 'foo'},
{type: button, text: 'ばー', action: 'bar'},
]
こうするとボタン一覧とかもできる