This is an example for what I want to achieve, currently set up in the sidebar like this:
(…)
for obj in bpy.context.selected_objects:
row = layout.row()
row.label(text=obj.name)
???
row.prop(obj, “hide_viewport”, text="", emboss=False)
??? means I dont know what to do here, because afaik there is no operator or property available for active object. (active object is set with bpy.context.view_layer.objects.active = obj)
How do I make it work to switch the active object like the picture suggests?