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

3 次查看(过去 30 天)
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