How do I make a widget initialize as "invisible" in App Designer?

조회 수: 8 (최근 30일)
who what where
who what where 2019년 8월 27일
편집: who what where 2019년 8월 28일
I have an app where I've altered the functionality such that certain widgets are no longer used. Unfortunately, I don't want to delete them outright since I've been using their associated structures to hold various bits of data that I frequently query with the remaining widgets. I would like to make them completely invisible in the figure window though. Currently, I've moved them into the background or off the actual figure, but sometimes their imprints or "echoes" still appear. I saw that there is a 'visible' property for these widgets (ie: app.widgetname.Visible='off'), but I only know how to set this property after I've actually triggered a callback within my application. Is there a way to get the application to initially set these features as invisible when the application is started before any human interaction?

채택된 답변

Jason Liu
Jason Liu 2019년 8월 27일
When you click on "Run" for the .mlapp file in App Designer, this will trigger a startup function "startupFcn"(if you set up startup function in you app) to initialize the app. In your case, make sure you set those widgets to be invisible within the startup function. (Most of time the widgets were set visible by default)

추가 답변 (1개)

Cris LaPierre
Cris LaPierre 2019년 8월 27일
편집: Cris LaPierre 2019년 8월 27일
Set their visibility property to "off".
In Design View, select the component, and in the component browser (on the right) under Inspector, expand Interactivity and uncheck Visible.
  댓글 수: 1
who what where
who what where 2019년 8월 27일
편집: who what where 2019년 8월 28일
Oh wow....I thought I'd already looked through all those options in the properties tab. I don't know how I missed that! Thanks for the reply!
Edit: This worked just fine for a few of the widgets, but there were others that lacked this option. I ultimately set up a 'startupFcn' to hide those components.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by