필터 지우기
필터 지우기

How to execute checkbox callback by using pushbutton callback

조회 수: 2 (최근 30일)
Hi,
I will be thankful if you could help me in this. I am new to matlab, i would like to click the pushbutton and in the same time it should execute the checkbox or listbox callback(similar to clicking the checkbox/listbox). How can i do this.
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 5월 20일
This looks much like a shorter version of the Question http://www.mathworks.com/matlabcentral/answers/38850-need-help-how-to-develop-an-gui-with-callbacks

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2012년 5월 20일
h = HandleOfOtherControl;
cb = get(h, 'Callback'); %this retrieves the callback
cb{1}(h, [], cb{2:end}); %this invokes the callback
Warning to other readers: this sequence will not work for callbacks constructed by GUIDE, as those use are strings instead of cell arrays of that contain the function handle. Fortunately Karthick KJ does not appear to be using GUIDE (or at least has not mentioned using GUIDE in any posting.)
  댓글 수: 7
Walter Roberson
Walter Roberson 2012년 5월 26일
Writing a common routine to be called by both callbacks makes clearer code, but invoking the stored callback for a function makes the callbacks more independent.
Karthik KJ
Karthik KJ 2012년 5월 26일
Ok. I just used the callback to listbox from the checkbox.
sp2_V04('listboxyaxis_tag_Callback',handles.listboxyaxis_tag,[],handles)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by