From: Nischal on
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
From: Walter Roberson on
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().