App UIFigure Visibility Bug

14 ビュー (過去 30 日間)
Mehdi Ansarey
Mehdi Ansarey 2023 年 10 月 26 日
回答済み: Sreeram 2024 年 8 月 9 日
I have Multi-Windows Application written with GUIDE. Currently I Tried to Migrate to App Designer.
My Problem: I Design An App, That Its Visibility Turned Off In App Startup Callback.
In Some Place, I Change The Position of That Windows (In Other Program Module), But Before User Decide to Click A Menu to show That App.
Its Very Odd That, The Windows Appears As Soon As Position Changed. I Tried to Turn It Visiblity Back to Off Again After Position Change Line. But It Didnt Work. Also Functions Like drawnow not useful (At First I Thought It is An Incomplete rendering problem).
This Is Secondary Windows That Should Be Invisible (app2):
function startupFcn(app)
app.UIFigure.Visible= "off"
end
In Master App, I Define ap2 Public Variable:
function startupFcn(app)
app.ap2= app2
end
And This Is Position Change In Some Callback That Tend To Show app2:
function ChangePositionButtonPushed(app, event)
app.ap2.UIFigure.Position= [100, 100, 1000, 700];
app.ap2.UIFigure.Visible
end
As you see, The 2nd Line Echo "off" Value for ap2.UIFigure, While It is shown.

回答 (1 件)

Sreeram
Sreeram 2024 年 8 月 9 日
Hi Mehdi,
I understand that app2 becomes visible when its position is altered from the master app, even though its “Visible” property is set to “off”. I was able to reproduce the issue in MATLAB R2023b.
I have verified that this issue is not present in MATLAB R2024a. If you wish, you may upgrade to the latest MATLAB version.
You can work around the issue in MATLAB R2023b by toggling visibility to “on” and then back to “off” right after updating its position:
app.ap2.UIFigure.Visible = "on";
app.ap2.UIFigure.Visible = "off";
However, the UI figure might still be briefly displayed on the screen before getting hidden.
Hope this helps.

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by