Activating a UIControl element programmatically

I've been playing around with the GUIDE tutorial app simple_gui, described here. Specifically, I am controlling the app programmatically and want to make sure I don't miss anything.
First, where I'm at so far:
I initialize the app with
h_sg = simple_gui;
Then, I can get handles to each control element with
h_mesh = h_sg.Children(4);
h_popup = h_sg.Children(1);
Finally, I can control the dataset menu and plot buttons like this:
h_popup.Value = 2;
notify(h_popup, 'Action');
notify(h_mesh, 'Action');
My main question is, am I missing anything? Is there anything else MATLAB does when you interact with a UIControl besides set the value and notify listeners (a.k.a. call notify())?

回答 (1 件)

Sean de Wolski
Sean de Wolski 2018 年 7 月 10 日

0 投票

You should really consider using appdesigner. Not only is there better support for listeners, there's also a ui testing framework that allows you to do whatever interactions you want programmatically:
It's also where all of MathWorks development is focused and has already far surpassed the capabilities of GUIDE.

3 件のコメント

Lawrence
Lawrence 2018 年 7 月 10 日
That is out of my hands. The decision to use GUIDE was made when app development started, 7 years ago.
Sean de Wolski
Sean de Wolski 2018 年 7 月 10 日
Still may not be an option but potentially worth knowing about at least:
Lawrence
Lawrence 2018 年 7 月 10 日
Thank you. It is useful to know that conversion tools exist. We wouldn't be able to make the switch, however, until toolbars and context menus are supported.

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

カテゴリ

ヘルプ センター および File ExchangeDesktop についてさらに検索

製品

リリース

R2018a

質問済み:

2018 年 7 月 9 日

コメント済み:

2018 年 7 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by