How to show a dialog box (inputdlg) in full screen?

9 views (last 30 days)
Ina Z.
Ina Z. on 13 Aug 2021
Edited: DGM on 14 Aug 2021
In the end of my experiment (which was always shown in full screen) I want to ask for demographical subject data using a dialog box. The dialog box always shows up as an pop up window, but how can I let it be shown as a full screen? So far this is my pop-up dialog box
prompt={'Bitte füllen Sie folgende Felder aus \n Wie alt sind Sie?','Was ist Ihre klinische Diagnose?', 'Wie groß sind Sie? (in cm)' 'Wie viel wiegen Sie?'};
name='Bitte füllen Sie folgende Felder aus.';
numlines= 1;
defaultanswer={'', '', '', ''}; %% no default answers to prevent triggering
options.Resize='on';
options.WindowStyle='normal';
answer=inputdlg(prompt,name, numlines,defaultanswer,options);
I know, that I can define the numlines and also define whether the subject can or cannot resize the window by setting the options.Resize to on or off, but I want the dialogbox to be shown on full screen (or alternatively flipped onto a white screen, so the script is not seen in the background).
Can anybody help me with that?

Answers (1)

DGM
DGM on 14 Aug 2021
Edited: DGM on 14 Aug 2021
As far as I know, you can't really. Those dialogs don't have simply accessible properties, and they block execution.
There's this, which isn't useful for your needs, but it makes it pretty apparent that setting the position property isn't an option.
A sane, but unfortunately tedious solution would be to simply make your own dialog programmatically using uifigure and the appropriate text boxes and buttons. Then you can just specify the figure position directly.
A slightly less sane solution would be to use external system-level window management tools to resize the window based on its name. Working around the fact that inputdlg() blocks execution would add an extra layer of precarious inelegance to such a solution, but it's possible.

Categories

Find more on App Building 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!