Thread Subject: How to have drop down menu to select in inputdlg

Subject: How to have drop down menu to select in inputdlg

From: Nischal

Date: 21 Mar, 2010 23:15:06

Message: 1 of 2

Hello,

I want matlab to first create dialogue 'Input' with prompts...'A', 'B' and 'C'. Then 'Input' dialogue box should have all three prompts of A, B and C. Prompt B should have a default value of i.e. "99".

I can do everything upto above...

Now, I want all three prompts A, B and C of dalogue 'Input' to have drop down menu for predefined selection. How can I do that?

thanks,

Nick

Subject: How to have drop down menu to select in inputdlg

From: Walter Roberson

Date: 22 Mar, 2010 02:25:17

Message: 2 of 2

Nischal wrote:
> Hello,
>
> I want matlab to first create dialogue 'Input' with prompts...'A', 'B'
> and 'C'. Then 'Input' dialogue box should have all three prompts of A, B
> and C. Prompt B should have a default value of i.e. "99".
> I can do everything upto above...
>
> Now, I want all three prompts A, B and C of dalogue 'Input' to have drop
> down menu for predefined selection. How can I do that?

In order to do that within inputdlg(), you would have to edit the matlab
provided source. inputdlg() creates a modal dialog, so it does not
return a handle to the box to allow you to customize what it does.


If you are desperate, you could start a timer with a short timeout and a
callback function, and then start the inputdlg() . The callback on the
timer function would locate the handle to the figure that inputdlg()
creates, and then go inside the figure and add the uicontrol's at the
appropriate positions (this might require resizing the figure to fit
the new entries.) A callback on a timer is about the only way to defeat
the modal nature of the inputdlg().

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us at files@mathworks.com