I'm really struggling finding info or anything about this.
I've made a an UI list with an imported list of material and displayed on the 3d view ui panel. So far a button 'set material' is changing the material on active object and it works fine.
But I would like to remove this button and directly change the material when I press on an item in the list.

IntPropertyand use theupdatecallback to know when an element is clicked – Gorgious Jun 10 '21 at 08:52