필터 지우기
필터 지우기

colormapeditor

조회 수: 7 (최근 30일)
Razvan
Razvan 2011년 11월 16일
답변: Robin Larsson Nordström 2023년 11월 8일
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

답변 (2개)

Naz
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.
  댓글 수: 1
Razvan
Razvan 2011년 11월 16일
Thanks. I knew this was an option. Is there another way to continue the code, exactly when you press some button in the |colormapeditor| window, without needing to press another button after that? And how can I test if the user pressed Yes, Apply, or Cancel in the |colormapeditor| window?
Razvan

댓글을 달려면 로그인하십시오.


Robin Larsson Nordström
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:

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by