Button with custom code for external changes

Is it possible to add to a FigureWidget a button, that does not change it’s properties, but instead changes (for example) an array, that is not liked to this figure at all?