# how do I build a list-multi-select widget using a box with operators?

What I'm trying to do is write a ui for an export script to export multiple selected actions of the selected armature(s) to multiple files.

I can't seem to find an example to define an operator for use in a layout.box() instance which can be selected like the layout.template_list() widget.

Of course, I'm working with a python list of gathered actions, so that widget is out of the question, since Blender has no internal support for this.

So, how do I define an operator which can be "selected" from a box widget?

Mockup of what I'm working with:

definitely draw(this, context ):

# not typing the gathering code.

box = layout.box()
for action in gathered_actions:
row = box.row()
row.label( text=action.name, translate=False, icon="ACTION" ) # what I currently have.


I want to replace the label with an operator, but don't know how to build the operator.

Might I note, I'm not experienced with blender, just python, so I'm delving into a new area with this.

• Not sure what do you mean by box widget. Something like this: blender.stackexchange.com/questions/30444/…? Otherwise please provide an example. – p2or Sep 14 '16 at 8:15
• layout.box() only gives a visible variation from the surrounding panel, anything inside the box works the same as any other item you place in a panel. – sambler Sep 14 '16 at 10:10
• @poor yes, although your example uses template_list instead of box, which doesn't work with python lists... I'm currently throwing labels inside the box which works like I want, except I can't "select" them, so how do I design an operator to replace the label? – Tcll Sep 14 '16 at 11:54
• What kind of lists? Can you elaborate? Some operators and the UIlist in a box (regarding to your comment). – p2or Sep 14 '16 at 12:38
• Raw python lists list() containing the actions gathered from the selected armature(s). – Tcll Sep 14 '16 at 13:22

Ok, so after some reviewing and paying around with stuff...