Using inputdlg without freezing other figures

5 次查看(过去 30 天)
Hi,
I'm trying to write a code that requires the user to go through some frames of a video file and gather information from the frames, and then to input that information in a dialog box.
Here is my code currently:
implay(fullfile(src_path,'Vids',strcat('Edge_',filename,format)));
prompt = {'Enter y-component of SUBSTRATE position:',...
'Enter y-component of TIP position:'}; %Dialog box prompts
dlg_title = 'Tip/Substrate Position';
def = {'Use interactive video player and image toolbox to find value',...
'Use interactive video player and image toolbox to find value'};
num_lines = 1;
answer2 = inputdlg(prompt,dlg_title,num_lines,def);
sub_pos = str2num(answer2{1,1});
tip_pos = str2num(answer2{2,1});
The problem with the current code is that once the dialog box opens, the video player is frozen...the only figure I can interact with is the dialog box.
I want to find a way to make it so that both the video player and the dialog box are accessible at the same time. After the user enters the information into the dialog box and clicks "OK", I then want the program to resume through the rest of the code (not shown).

回答(1 个)

Walter Roberson
Walter Roberson 2013-8-20
Try passing 'WindowStyle', 'normal' as additional options to inputdlg()
My suspicion is that in the end you are going to need to construct your own input dialog that creates the dialog you want, and then your routine uses waitfor() the OK to be pressed and then fetches the stored answer from the figure you created to hold the dialog.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by