필터 지우기
필터 지우기

How can I remove the option to close a figure in a ToolGroup?

조회 수: 6 (최근 30일)
Steven H
Steven H 2022년 6월 14일
답변: Paras Gupta 2023년 9월 14일
With the snippet of code below I can create a nice looking interface and a figure in which I can create all sorts of controls. However, I'd like to remove the option to close the figure inside it. Is there a way that I can remove the figure title and close button? It's essentially the look the ToolGroup has if there are no figures added.
hToolGroup = matlab.ui.internal.desktop.ToolGroup('MWE');
hToolGroup.disableDataBrowser();
hToolGroup.open();
fig = figure;
hToolGroup.addFigure(fig);
uicontrol(fig, ...
'Style', 'edit', ...
'String', 'A minimal working example' ...
)

답변 (1개)

Paras Gupta
Paras Gupta 2023년 9월 14일
Hi,
I understand that you want to hide/remove the close button from the UI Figure tab in the Tool Group created using the provided code.
In MATLAB, there is no built-in way to hide the close button. We can, however, specify the behavior when the close button is pressed by modifying the CloseRequestFcn callback of the created UI Figure. Please refer to the following documentation to learn more about the same.
If you need to have more control over the appearance and behavior of the figure's tab, you might consider creating a custom UI using MATLAB's App Designer. Please refer to the following documentation to gain a comprehensive understanding of App Designer and its functionalities
Hope this helps.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by