colormapeditor
6 次查看(过去 30 天)
显示 更早的评论
Hi,
I would like to use colormapeditor inside a GUI, and I want a pause in the program that waits for me to finish with the colormap settings and then to continue in the code. I don't know how to make this pause, and to test if the user pressed OK, apply or other button inside colormapeditor. In other words I want to get the button that was pressed and then to continue in the code. Any suggestions?
Thanks,
Razvan
0 个评论
回答(2 个)
Naz
2011-11-16
Quick way to fix the problem is:
colormapeditor;
pause;
%conntinue your code
With this, after the colormap editor appears, you can do whatever you need, then close it by clicking OK and after press any key to resume the program.
Robin Larsson Nordström
2023-11-8
Hi,
Adding a listener for the colormapeditor event EditorClosed works in 2023b (undocumented feature, so might stop working in a later release).
colormapeditor;
cme=getappdata(0,'CMEditor');
addlistener(cme.ColormapEditor,'EditorClosed',@(src,event)uiresume);
disp(string(datetime("now")) + ' colormapeditor opened')
uiwait % pause program, wait for callback uiresume
disp(string(datetime("now")) + ' colormapeditor closed')
Please see my longer answer here:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!