Display message window

A simple message window similar to msgbox without button
3.4K 次下载
更新时间 2007/6/13

查看许可证

SHOWINFOWINDOW creates a small dialog window which displays a user-defined message. It is quite like MATLAB's msgbox but without an OK button. Although msgbox could be used for the simple display of a message that informs the user about a process being performed (and is not expected to last long, else a waitbar/timebar could be used but at a cost of running time), the presence of the OK button that closes the window on press could be annoying. SHOWINFOWINDOW resolves this problem by removing the button. Additionally, if you wish to write a script or create a GUI where you do not wish the user to accidenatlly hit the close button in the upper right corner of the window, you can remove the comment on line 82 of the code concerning the 'CloseRequestFcn' property of the dialog. However, if you do that you must assign a handle to showinfowindow so you can change its 'CloseRequestFcn' property to 'closereq' when your process is done or else you might end up with a non-closing window! If that happens, one way to resolve this could be to use the findobj function:

non_closing_window_handle = findobj('CloseRequestFcn','');
set(non_closing_window_handle,'CloseRequestFcn','closereq')
close(non_closing_window_handle)

Although this script was created for something trivial, I found it useful especially in my GUIs where I wanted to briefly display some information in a very simple way and especially when I wanted to avoid someone causing such windows to close when running a process within a GUI, probably resulting in errors. Further help on its usage with some syntax examples can be found inside the code.

引用格式

Panagiotis Moulos (2024). Display message window (https://www.mathworks.com/matlabcentral/fileexchange/15288-display-message-window), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R14SP3
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Dialog Boxes 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0