How can I change the function inputdlg from another script?
19 views (last 30 days)
Show older comments
Hello,
I'm trying to edit the function inputdlg from another script.
I want to change the font size of the GUI. I'm aware that you can edit the function and set the fontsize yourself.
But I'm trying to make it have the same effect on other computers by setting an indication to change the font size.
Thank you for your help.
0 Comments
Answers (1)
Walter Roberson
on 6 Jan 2017
inputdlg() uses get(0,'FactoryUicontrolFontSize') to fetch the font size to use, but it is not possible for users to change FactoryUicontrolFontSize .
You could pass an options structure that included 'WindowStyle', 'normal', which would result in inputdlg() continuing before input is received -- continuing without having destroyed the window. You could then go in to the figure and set the fontsize of the appropriate objects and then have it wait for input, and then arrange to get the input to where it belongs (and destroy the figure.)
But... this would require a change to how you call inputdlg() along with adding a bunch of code afterwards. If you took this approach then it would probably be easier to write a wrapper function that did all of the work for you, and then always use that function instead of inputdlg() . already-coded calls to inputdlg() would not be affected, which could be a problem.
You could get into putting your own inputdlg() higher up on the path, but...
My recommendation would be to file an enhancement request for inputdlg() to use DefaultUicontrolFontSize . Or, at the very least, to accept font options (though that does not help deal with the problem of different screen resolutions and wanting inputdlg() to be readable by default.)
0 Comments
See Also
Categories
Find more on Subplots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!