Create radiobutton without button group

조회 수: 3 (최근 30일)
Florian Berzsenyi
Florian Berzsenyi 2022년 11월 9일
댓글: Voss 2022년 11월 10일
I would like to create radio buttons without a button group, align them myself by assigned them to a layout as their parent, and implement a simple toggle function for all radio buttons within a ButtonPushed callback (same for all buttons).
However, when I call uiradiobutton(), MATLAB only accepts ButtonGroups as parent handle.
>> uiradiobutton(uifigure())
Error using uiradiobutton
'Parent' value must be specified as a ButtonGroup object.
Why does MATLAB not allow me to use a uilayout or a uifigure object as parent of a radio button?

답변 (1개)

Voss
Voss 2022년 11월 9일
I don't know why a radio button's parent must be a button group, but you can set the button group's BorderType to 'none', so that the radiobutton(s) appear to be contained directly in the button group's parent container.
  댓글 수: 2
Florian Berzsenyi
Florian Berzsenyi 2022년 11월 10일
yes, I could do that. I would like to arrange the radio buttons horizontally (left-right), and I am not able to find a property in button group that does modify the arrangement.
Voss
Voss 2022년 11월 10일
I am also unable to find such a property listed in the documentation.

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

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by