Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

pushbutton coloring problem

조회 수: 1 (최근 30일)
marvin
marvin 2011년 5월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
Using 64-bit R2010a matlab for mac I have a problem with pushbutton coloring. Basically doing
figure
Position = [0.2 0.2 0.2 0.2]
hdl = uicontrol('Units', 'Normalized', 'Position', Position, ...
'Style', 'PushButton', 'BackgroundColor', [0 1 0])
Should create a colored pushbutton but instead the pushbutton remains white. Adding Foreground color does not solve it. There's no problem with this code on e.g. 32-bit platform. Anybody an idea for a fix?

답변 (1개)

Jarrod Rivituso
Jarrod Rivituso 2011년 5월 16일
Sounds like a bug. I would report it using the "Contact Support" button here:
Potential workaround is to try setting the CData property
figure
Position = [0.2 0.2 0.2 0.2]
hdl = uicontrol('Units', 'Normalized', 'Position', Position, ...
'Style', 'PushButton')
set(hdl,'CData',cat(3,zeros(500),ones(500),zeros(500)))
Hope this helps!

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by