I know a UIList class is not a big deal to write, but for multiple reasons, I'd like to write one class and use it for handling two PropertyCollection lists. So if I have a class for a UIList like this, can I use it more than once on the same panel for different data in each location in the layout where it's used? If not, what prevents that?
class MY_UL_CustomList(UIList):
"""Demo UIList."""
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
custom_icon = 'FILE'
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.label(text = str(index) + ' ' + item.name, icon = custom_icon)
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label(text==item.name, icon = custom_icon)
list_id– batFINGER Apr 07 '21 at 05:34