Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
questdlg CloseRequestFcn

Subject: questdlg CloseRequestFcn

From: machatsk

Date: 16 Aug, 2010 16:22:08

Message: 1 of 4

Hello all,
     I have function that displays warning messages to the user of a GUI when the data they are processing is less than perfect. The user can process the data or skip it and move on to the next set of data without starting the GUI over again. It passes its output skip_data to the main function for the GUI.
    The function works great, but when the user presses the exit in the top left corner of the questdlg() the red text of death appears in the command window because the output is not assigned. I'm assuming this has to do with the questdlg() CloseRequestFcn. Currently the output is set in the CASE code when the user selects one of the 3 buttons. How can I set my output to a value when the user presses close?
             Thanks
             Maxx

 

Subject: questdlg CloseRequestFcn

From: Steven_Lord

Date: 16 Aug, 2010 17:11:30

Message: 2 of 4



"machatsk " <chatskom@chemimage.com> wrote in message
news:i4bojg$2o3$1@fred.mathworks.com...
> Hello all,
> I have function that displays warning messages to the user of a GUI
> when the data they are processing is less than perfect. The user can
> process the data or skip it and move on to the next set of data without
> starting the GUI over again. It passes its output skip_data to the main
> function for the GUI.
> The function works great, but when the user presses the exit in the top
> left corner of the questdlg() the red text of death appears in the command
> window because the output is not assigned.

Can you show the specific "red text of death" that appears in the Command
Window? According to the documentation:

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/questdlg.html

"If the user presses the close button on the dialog without making a choice,
button is set to the empty string."

and I've just checked -- this is the behavior I observed. Does your code
correctly handle the situation where the output from QUESTDLG is an empty
string?

> I'm assuming this has to do with the questdlg() CloseRequestFcn. Currently
> the output is set in the CASE code when the user selects one of the 3
> buttons. How can I set my output to a value when the user presses close?

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/otherwise.html

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: questdlg CloseRequestFcn

From: machatsk

Date: 16 Aug, 2010 17:36:04

Message: 3 of 4

"Steven_Lord" <slord@mathworks.com>

   I get the warning that the output skip_data (and maybe others) is not assigned - because the function is closed before it can be assigned.
   I tried to use otherwise, but it won't work because one of my buttons (cases) is labeled INFO and brings the user to another questdlg() with its own buttons. So no matter where I put the otherwise there is always a problem.
   Should I use varargout?

Subject: questdlg CloseRequestFcn

From: Steven_Lord

Date: 16 Aug, 2010 20:27:29

Message: 4 of 4



"machatsk " <chatskom@chemimage.com> wrote in message
news:i4bsu4$bv5$1@fred.mathworks.com...
> "Steven_Lord" <slord@mathworks.com>
>
> I get the warning that the output skip_data (and maybe others) is not
> assigned - because the function is closed before it can be assigned. I
> tried to use otherwise, but it won't work because one of my buttons
> (cases) is labeled INFO and brings the user to another questdlg() with its
> own buttons. So no matter where I put the otherwise there is always a
> problem.
> Should I use varargout?

Perhaps you should show the code that's causing the "red text of death".

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us