MATLAB callback when saving figure file -


i need check programmaticall whether fig (guide) file saved or not, bascially need callback when:

myfigure_savedcallback(hobject, varargin) 

i didn't find online, guess not possible, can verify this?

solved:

so found out how myself. in guide editor can open toolbar editor , change icon-buttons gui has. there somewhere field clicked callback. can enter regular callback-formalism, e.g.

mygui('uipushtool2_clickedcallback',hobject,eventdata,guidata(hobject)) 

and add callback code. in particular callback, ud-flag saved/unsaved can handled if necessary.

no, far know there no callback figures (or other hg components) executes when saved.

however, think might able work around this. can create object of own executes code when saved - this:

classdef mytest < handle         methods                  function sobj = saveobj(obj)             sobj = obj;             disp('saved') % put code here         end             end     end 

then can create 1 of these objects, , store in, example, userdata property of figure. when figure gets saved, object, , whatever code executed.

i imagine there may ways in above workaround might defeated various things user do. care, might enough needs.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -