User input message box minimizes uifigure, how do I stop that from happening?

3 次查看(过去 30 天)
Im not sure how best to describe my issue but im trying my best. I have a uifigure with some checkboxes, drop down menus, and buttons. One thing I need to do is convert between unix time and hours:minutes:seconds. When you open the program you can select some options and eventually click run, the data is in unix seconds so it needs to be converted first, so the program is open and you click run and the message box pops up, you input the year, month, and day and the conversion happens. everytime I run the program and the message box pops up it minimizes the uifigure, its annoying and im trying to find a fix. Any ideas on why this happens? Below is the message box code:
prompt = {'Year:','Month:', 'Day: '};
dlgtitle = 'Input';
fieldsize = [1 45; 1 45; 1 45];
answer = inputdlg(prompt,dlgtitle,fieldsize);
When I go step by step, the uifigure minimizes when I reach the prompt line, is there something I have here that automatically minimizes other figures? All this is within a function that calculates different things depending on the checkbox options. Is there a way to stop the uifigure from minimizing? Thanks!
  3 个评论
Bradley
Bradley 2024-4-15
The code is nearly 2000 lines long so im not sure what part would be helpful to answer this question. I also am still learning the termonology of matlab and coding in general, thank you for answering my question. I stepped through the code from the beggining and its when the prompt line executes that the uifigure is minimized. I have to step into the function to get to this part of the code and its one of the first things the function does. Im not sure if any of that information matters here but its very confusing to me. Thanks again for the help!
Voss
Voss 2024-4-15
If you would, please upload the entire code here (in a ZIP file if it's many files), using the paperclip button, and I'll see if I can reproduce the problem in my copy of R2023b or see any reason why this might be happening.
At the very least, it's likely there's an easy workaround, which is to restore the uifigure after it's minimized, by calling the figure() function on it.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by