原帖由 coolshinning 于 2007-9-17 15:32 发表
用waitbar的话,在STOP_callback里面应该怎么写呢?我用quit直接把matlab给关了,有没有什么命令能象ctrl-c一样只是退出当前的程序而不是退出matlab呢? -
- h = waitbar(0,'Please wait ...','CreateCancelBtn',@btnWaitbarCancel_Callback,...
- 'WindowStyle','Modal');
- for j = 1:n
- .....
- if ishandle(h)
- waitbar(j/n);
- else
- return;
- end
- if ishandle(h)
- delete(h);
- end
复制代码- function btnWaitbarCancel_Callback(h,varargin)
- %call delete (because close-request function also calls this function)
- fig_handle = get(h,'parent');
- delete(fig_handle);
复制代码 |