I'm trying to color my list items according to each item's field.
type InventoryModel struct {
walk.ListModelBase
Items []models.Item // <-- these
}
I found out that I can set an ItemStyler for my ListBox, but from there what should to do is quite obscure.
I looked through the models and I can see I have to implement ListItemStyler and ListItemStyle, however, I am quite stuck as I feel like I would need to kind of reinvent the wheel by doing that, while I just want to apply a LineColor to my items.
Is there a preferred way to do that, or am I diving into a big chunk of code for a simple thing ?
I'm trying to color my list items according to each item's field.
I found out that I can set an
ItemStyler
for myListBox
, but from there what should to do is quite obscure.I looked through the models and I can see I have to implement
ListItemStyler
andListItemStyle
, however, I am quite stuck as I feel like I would need to kind of reinvent the wheel by doing that, while I just want to apply aLineColor
to my items.Is there a preferred way to do that, or am I diving into a big chunk of code for a simple thing ?