how to call the callback in GUI ?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Niki
am 8 Sep. 2011
Bearbeitet: Amirhosein Ghenaati
am 6 Nov. 2014
I put this label into the figure that I created but how can I active it ? I want to load data , do you have any idea?
m = uimenu('Label','&File'); uimenu(m,'Label','Open','Callback','Mohammad');
2 Kommentare
Jan
am 8 Sep. 2011
What exactly does "I want to load data" mean? What do you mean by "activate"? Usually a menu is activated by the mouse event. Do you want to call the callback function Mohammad manually?
Akzeptierte Antwort
Wesley Ooms
am 8 Sep. 2011
if i understand correct, instead of 'Mohammad', you should write {@Mohammad} so that it becomes
uimenu('Label','&File'); uimenu(m,'Label','Open','Callback',{@Mohammad});
now you can write your function
function varargout = Mohammad(varargin);
that function can load the data for you
1 Kommentar
Amirhosein Ghenaati
am 6 Nov. 2014
Bearbeitet: Amirhosein Ghenaati
am 6 Nov. 2014
if you defines Mohammad in your current directory it works well too
m = uimenu('Label','&File');
uimenu(m,'Label','Open','Callback','Mohammad');
for example define new func in your directory
function Mohammad()
disp('rrr')
end
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Install Products finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!