필터 지우기
필터 지우기

Is is possible to change the font size of a questdlg's buttons?

조회 수: 25 (최근 30일)
Albert Bing
Albert Bing 2019년 12월 28일
댓글: Walter Roberson 2020년 1월 2일
I know the message can be set by opts in answer = questdlg(quest,dlgtitle,btn1,btn2,btn3,opts).
But is it possible to also change the font size of the buttons?
This page default-property-values gives some infomations. I checked the result of get(groot, 'factory'). There are factoryTextFontSize, factoryUibuttongroupFontSize, and factoryUicontrolFontSize.
But the command set(groot, 'factoryTextFontSize', 12) didn't work. Apparently get(groot, 'default) gives only 5 properties.
So how to deal with the default settings above?

채택된 답변

Walter Roberson
Walter Roberson 2019년 12월 31일
The buttons are created using uicontrol(), which permits html 1.1 . For example,
questdlg('Hello World ?','Hello','<html><font size="20">World','<html>what<sup>now','<html>what<sup>now');
Note that changing the font size does not make the buttons any larger, just the font size.
  댓글 수: 2
Albert Bing
Albert Bing 2020년 1월 2일
Thank you! It works.
Just wonder from which version the html was supported.
Walter Roberson
Walter Roberson 2020년 1월 2일
I am not sure, but some release before 2009.

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

추가 답변 (2개)

Mohammad Sami
Mohammad Sami 2019년 12월 30일
편집: Mohammad Sami 2019년 12월 30일
You can use the optional opts argument to enable the Interpreter tex. Then you can use the supported modifier \fontsize{..} in front of your text.
questdlg('\fontsize{20}Hello World ?','Hello',struct('Default','','Interpreter','tex'));
You can check the documentation for all the supported modifiers.
  댓글 수: 1
Albert Bing
Albert Bing 2019년 12월 31일
This opts only changes the message's font. What I really want to find out is how to change the font of the buttons, the selection buttons with text "Yes", "No", "Cancel" by default.

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


Image Analyst
Image Analyst 2019년 12월 31일
I believe that button text is an operating system setting. You can change it there. Or maybe you can override that with the things others showed here. If you want something totally custom (button sizes, locations, colors, etc.) you'll have to build your own little applet with GUIDE or App Designer.

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by