MATLAB: Input Arguments for Callback Function in a listener

addlistenerevent.eventdatamatlab gui

I am trying to use a listener to update one GUI when the data in another GUI changes. I think I got the listener defined, at least I can see that it has been added to the handle structure, but I dont understand what I should set the inputs to the callback function to. From the documentation I can see that that inputs must be a object handle and event.EventData object but I'm not quite sure what that refers to.
%Get GUI_1 data
gui1_handle = findobj('tag','GUI1');
gui1_data = guidata(gui1_handle);
% Add listener to GUI_2 with trigger from GUI_1
handles.listener=addlistener(gui1_data.pitch1,'Value','PostSet',@updategui2);
% Update handles structure
guidata(hObject, handles);
function updategui2(?????,??????)
gui1_handle = findobj('tag','GUI1');
gui1_data = guidata(gui1_handle);
x=num2str(guidata(gui1_data.pitch1))
set(handles.text3,'string',x);
Thank you for your help

Best Answer

If you do not need to use those inputs, then define your function using input placeholders:
function updategui2(~,~)
FYI, the object handle is quite useful if you want to know the value or status of the calling object, e.g. what value a button or text box has.