필터 지우기
필터 지우기

Set uifigure defaults doesn't work the same as figures

조회 수: 3 (최근 30일)
Steve Zissou
Steve Zissou 2023년 1월 17일
답변: Steve Zissou 2023년 1월 23일
with figures I can set the defaults using
set(groot, 'defaultFigurePosition', [1 1 1 1])
but I can not do the same for uifigures
set(groot, 'defaultuiFigurePosition', [1 1 1 1])
Error using matlab.ui.Root/set
uifigureposition is an invalid class name
This is also an issue with the new components i want to use uifigures for, like uilabel, or uieditfield.
Is there something i am doing wrong with the new uifigures when trying to set the defaults?

채택된 답변

Steve Zissou
Steve Zissou 2023년 1월 23일
In Summary:
Both UIFigures and Figures are matlab.ui.Figure and so both use the defaults defined similar to
set(groot, 'defaultFigureUnits', 'normalized')
However there seems to be a bug and UIFigures are not currently use these defaults and a ticket has been submitted.
The new ui comonents like uilabel (which is a matlab.ui.label) do not have a units property like the uicontrol('style', 'text') do.
When setting defaults, use
class(uilabel)
class(uifigure)
to figure out the class name for use in the set(groot) command

추가 답변 (1개)

Matt Butts
Matt Butts 2023년 1월 18일
이동: Adam Danz 2023년 1월 18일
I believe both figure and uifigure use the same default. Are you seeing thet uifigures are not utilizing your default that you set in DefaultFigurePosition?
  댓글 수: 7
Adam Danz
Adam Danz 2023년 1월 18일
matlab.ui.control.Label objects do not have a public units property. This prevents you from setting uilabel units.
Steve Zissou
Steve Zissou 2023년 1월 18일
Ah okay, yes i see that matlab.ui.control.Label does not have a public units property. However it does have a public position property, and i get the same error when trying to set its default. Should this be possible?
set(groot, 'defaultLabelPosition', [1 1 1 1])
Error using matlab.ui.Root/set
labelposition is an invalid class name

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

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by