MATLAB Answers

Translated by

このページのコンテンツは英語から自動翻訳されています。自動翻訳をオフにする場合は「<a class="turn_off_mt" href="#" onclick="window._kiq.push(['set', { 'event': 'Turn off MT' }]);">ここ</a>」をクリックしてください。

0

Creating a drop-down list of available fonts in App Designer

Krithi Gopalan さんによって質問されました 2017 年 6 月 8 日
最新アクティビティ Shruti Shivaramakrishnan さんによって 回答されました 2017 年 6 月 14 日
I want to create a drop down list of all the available fonts in App Designer, but a couple things went wrong in the process.
1. I attempted to enter individual options by hand in this area (shown in the image below), but they all got erased when I clicked a different spot on the screen. I just wanted to alert everybody to this issue.
2. I want to be able to directly specify the value of the property rather than inputting 240 individual list items in the design view screen. This is my callback code, but App Designer doesn't seem to like the fact that I am updating my drop-down property in the callback function.
app.GraphFontDropDown.Items = listfonts;
value = app.GraphFontDropDown.Value;
set(gca,'FontName',value);
Is there a way to fix this, or do I have to create individual items in my drop-down list? Thanks!

  2 件のコメント

Can you elaborate what you're seeing when you run your callback code? Is there an error message you're trying to fix or is it that the font isn't getting reflected on your axes?
There isn't an error message and the font does show up on my axes. The code just doesn't incorporate my update to the Items property when I assign it to listfonts. It wants me to put drop down list options into the design view area by hand, and I was just wondering if there was an easier way to do this.

サインイン to comment.

1 件の回答

回答者: Shruti Shivaramakrishnan 2017 年 6 月 14 日

Please view the attached mlapp file. It contains the code specified which performs the functionality specified. Please provide details as to what functionalities would need to be added or required.

  0 件のコメント

サインイン to comment.



Translated by