Msgbox pop up behind GUI

20 Ansichten (letzte 30 Tage)
chlor thanks
chlor thanks am 3 Aug. 2016
Kommentiert: chlor thanks am 3 Aug. 2016
I am trying to add a message box to serve as an instruction for my user of the GUI I made (Thanks to all your help with the process of making it!!)
I add the following line in my GUI's OpeningFcn:
msgbox('cool stuff', 'instrcution');
However this message box pop up behind my GUI and it very likely not to be seen at all by the user.
Is there a way to make my message box
  • pop up inside my GUI?
  • the user will have to read it and press ok to close it before using the GUI?
Thank you all for great help!

Akzeptierte Antwort

Adam
Adam am 3 Aug. 2016
Move it into the Output_Fcn instead.
In the OpeningFcn it gets created before the GUI creation is completed so when that GUI creation does complete it takes over focus. The OutputFcn is called after GUI creation.
  5 Kommentare
Adam
Adam am 3 Aug. 2016
I'm sure you will find it in the help if you ever need it, but a modal GUI is just one that blocks all other GUIs while you wait for the user to do whatever it is they are expected to do on the GUI (e.g. a dialog box expecting an ok or cancel answer). uiwait is just a command used in conjunction with this to tell the code to wait until the the thing being waited for is closed.
chlor thanks
chlor thanks am 3 Aug. 2016
Makes sense, I will take a note of this~

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by