function alexerror(msg) %ALEXERROR Open an error dialog box % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % global Uibgcolor ss ede qq qq=0; ss=msg; if isempty(Uibgcolor) Uibgcolor=[.55 .55 .55]; end pos=[0 0 0 0]; c=screencenter; pos(1)=c(1)-200; pos(2)=c(2)-90; pos(3)=400; pos(4)=180; ef=figure('name', 'Error',... 'Resize', 'off',... 'NumberTitle', 'off',... 'Position', pos,... 'Color', Uibgcolor); ede=uicontrol('style', 'edit',... 'units', 'normalized',... 'pos', [0.03 0.45 0.94 0.5],... 'min', 1,... 'max', 10,... 'backgr', 'r',... 'fore', 'y',... 'horiz', 'center',... 'string', msg,... 'Callback', 'global ede ss;set(ede, ''string'', ss);'); uicontrol('style', 'frame',... 'units', 'normalized',... 'pos', [0.03 0.05 0.94 0.35],... 'background', Uibgcolor); okb=uicontrol('style', 'push',... 'units', 'normalized',... 'pos', [0.4 0.1 0.2 0.2],... 'horiz', 'center',... 'string', 'Ok',... 'Callback', 'global qq;qq=1;'); fprintf('%c', 7); while qq==0 if ~figflag('Error', 0); return; end end close(ef); return;