フィルターのクリア

Using timer function to waste time than close/remove/hide a button

2 ビュー (過去 30 日間)
Scuba
Scuba 2021 年 10 月 6 日
コメント済み: Scuba 2021 年 10 月 6 日
Basically, I've used the button tool and enlarged it so i can display something like a loading screen or splashscreen. I want to be able to show what ever is displayed in the button at the time before the program starts (the button will be englared to cover the application i just wanted to show what was behind...). And after a few seconds I want the button to be deleted/closed/removed so the user can access the program. I have read other questions similar to this topic online and I know this can be achieved using the timer function but I'm having trouble understanding and knowing what the syntax is to proceed with this. What would be the syntaxt that would intergrate the timer function with the button.
  2 件のコメント
Rik
Rik 2021 年 10 月 6 日
You actually don't want to integrate it with the button itself.
What you describe is that you want to start the timer function when your GUI starts. That function should contain something like pause(5) and should delete the button (or set the visibility to off (and maybe disable the hittest)).
What have you tried? Have you read the documentation for the timer function?
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread.
Scuba
Scuba 2021 年 10 月 6 日
編集済み: Scuba 2021 年 10 月 6 日
So, i've basically resused the same code that was done on a similar thread but they closed a uifigure. I've changed it so its in terms of closing the button but i dont know if im calling the button properties/syntax correctly well i know im not coz its giving me an error...

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

採用された回答

Walter Roberson
Walter Roberson 2021 年 10 月 6 日
Set the StartDelay to how long you want before the close. Set the TasksToExecute to be 1. Pass handles.text1 as the extra argument.
The callback should then be
function timeCallback(~, ~, button)
if ishghandle(button)
button.Visible = 'off';
end
end

その他の回答 (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