GUI Push Button Help!

6 ビュー (過去 30 日間)
Anna Steps
Anna Steps 2020 年 12 月 6 日
編集済み: Rik 2020 年 12 月 9 日
I am creating a GUI with a push button on the first slide. When the participant presses the push button, I want the push button to disappear and move on to a new GUI slide where the participant answers 5 different questions. How do I do that?

回答 (2 件)

Monisha Nalluru
Monisha Nalluru 2020 年 12 月 9 日
Hi Anna,
I would suggest create two button, one for each window unless the functionality and callbacks are same for push button in both windows.
In the first window when the user clicks the button, this leads to opening new window with 5 question and button in first window can be hidden or removed in callback as follows
function ButtonPushed(app, event)
%call function or code inorder to open new window
app.Button.Visible="off"; % button exists but no visible to user running the app
%or
delete(app.Button); %delete the pushbutton component
end
And once the user submit the answers you use can button in second window to evaluate the results with different callback.

Rik
Rik 2020 年 12 月 9 日
編集済み: Rik 2020 年 12 月 9 日
There are two strategies to do this. You can either put all buttons and other relevant objects in the same figure and set the visible property, or you can create multiple figures.
If you look at my FEX submission PhotoAnnotation you will see an example of how you could have a second figure (have a look at how I deal with the options window).

カテゴリ

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