フィルターのクリア

What this actually means?????

2 ビュー (過去 30 日間)
Santhosh
Santhosh 2017 年 3 月 2 日
コメント済み: Santhosh 2017 年 3 月 2 日
% Mygui('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in Mygui.M with the given input arguments.
How to use this??? Can this be used to call a sub function(namely a pushbutton) inside a gui from an external function which is a separate m file???

採用された回答

Walter Roberson
Walter Roberson 2017 年 3 月 2 日
I guess you could use it that way. I would not do that myself.
It is mostly for internal use by GUIDE, due to the way it creates wrapper code around callback functions in order to be able to pass the handles structure into each callback.
If you do use it, make sure you pass the correct hObject and event structure required by the target callback.
A cleaner way is to move the code you need activated into a function in a location accessible from both files, and have both places make appropriate calls into the work routine.
  7 件のコメント
Walter Roberson
Walter Roberson 2017 年 3 月 2 日
If you are using GUIDE, everything useful is within a callback, so you just pass that callback's copy of handles to the work_routine.
But if you just happen to have a different program from which you are invoking a GUIDE-created interface and you want to call the work routine from in there, then you first need to retrieve the handles structure. When you make an outside call to a GUIDE-created interface (by calling the function whose name is the GUI), then the routine returns the GUI figure handle as the return value. You would record that figure handle. From there,
handles = guidata(TheFigureHandle);
work_routine( handles );
Santhosh
Santhosh 2017 年 3 月 2 日
Thanks Walter. I got it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by