I need to check programmaticall whether a fig (guide) file was saved or not, so bascially I need a callback when:
myfigure_SavedCallback(hObject, varargin)
I didn't find anything online, so I guess it is not possible, can someone verify this?
SOLVED:
So I just found out how to do this by myself. In the guide editor you can open the Toolbar Editor
and change all the icon-buttons a gui usually has. There is somewhere the field Clicked Callback
. You can enter the regular callback-formalism, e.g.
mygui('uipushtool2_ClickedCallback',hObject,eventdata,guidata(hObject))
And add this callback to the code. In that particular callback, a UD-flag for saved/unsaved can be handled if necessary.
To check if the image was saved manually:
You can check if the
Filename
field of the figure is empty or not. As soon as the figure is saved it get the path of the saved figure.Run the code and save the figure manually yourself.
this will give you: