フィルターのクリア

how to make a window show up several times in matlab app designer?

2 ビュー (過去 30 日間)
Muazma Ali
Muazma Ali 2023 年 5 月 20 日
コメント済み: Walter Roberson 2023 年 6 月 4 日
Hi,I want to show up one window containing a listbox several times dependent on a number that user entered earlier and that I made a callback for. In other words I want to run a while loop. Is it possible also to write some code including while loop before I refer to another app in the callback function?
I have attached two simple apps to illustrate the problem; but I am not getting the right results, I am supposed to get a red lamp but the color is not changing...tester_flere_vinduer is using app2 in itself
  3 件のコメント
Walter Roberson
Walter Roberson 2023 年 5 月 20 日
When you have a fixed number of executions, it is more common to use a for loop.
Muazma Ali
Muazma Ali 2023 年 5 月 20 日
@Walter Roberson yes, the second alternative you mentioned ; I want it to pop up, have the user select , disappear , pop up againg happening the number of desired times , :)

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

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 5 月 20 日
I suggest creating it once, and setting its Visible property to 'off' when you do not need it. When you need it, set Visible 'on' and have the callback that validates selection set the Visible 'off' again after verifying the selection is valid.
for count = 1 : N
app.AppropriateHandleNameHere.Visible = 'on';
waitfor(app.AppropriateHandleNameHere.Visible, 'off');
end
  5 件のコメント
Muazma Ali
Muazma Ali 2023 年 6 月 4 日
@Walter Roberson Why should I not use one app to invoke another?, I feel it is easier..
Walter Roberson
Walter Roberson 2023 年 6 月 4 日
When you have multiple apps, you have to coordinate between them. You have to have a way to exchange data both ways, and you have to have a way to have one wait for the other to be ready.
Remember that the typical graphic user interface runs to create graphics objects and then returns the handle to a container, after having set up callbacks, and when the user triggers the callbacks, the creation code for the app has already returned -- so the invoking app is already back running and does not inherently have any way to know when the second app has input or results "ready" for the first app.
You can work these situations out, but it is typically notably easier to just use a single app.

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

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by