Add standard figure toolbar in app designer

20 次查看(过去 30 天)
I've seen the documentaiton on uipushtool and uitoolbar but I still don't understand how to recreate the standard figure default toobar (or at least some of its standard buttons) on an app designer figure;
  1 个评论
Ankush
Ankush 2022-8-18
I am facing a similar difficulty. Did you find any solution for this? Please do share

请先登录,再进行评论。

回答(1 个)

Srinik Ramayapally
Srinik Ramayapally 2021-7-12
Hey,
The figure toolbar is created by default when the figure is launched.
You can create a new toolbar by entering
your_figure_handle = figure;
tb = uitoolbar(your_figure_handle);
If at all you dont want to create a new toolbar but instead you just want to access the default one, you can do that by
defaultToolbar = findall(your_figure_handle,'Type','uitoolbar')
In the figure below a new pushtool has been created in the default figure toolbar
You can always add your own push tools and customize them, rearrange the existing ones and much more. For further information refer to the uitoolbar and uipushtool documentation
  1 个评论
Andrew Diamond
Andrew Diamond 2021-7-12
Hi Srinik,
That doesn't seem to work in app designer UIFigure matlab.ui.Figure (at least not R2021a for me)
K>> defaultToolbar = findall(app.UIFigure,'Type','uitoolbar')
defaultToolbar =
0×0 empty GraphicsPlaceholder array.
where as
tb = uitoolbar(app.UIFigure);
K>> tb
tb =
Toolbar with properties:
Children: [0×0 GraphicsPlaceholder]
seeems to produce an empty toolbar in the UI.
Regards,
Andy

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by