www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtools/@cgbrowser/addTimedStatusMsg.m

    function addTimedStatusMsg(h,msg,time)
%ADDTIMEDSTATUSMSG Add a timed status message
%
%  ADDTIMEDSTATUSMSG(CGB, MSG, TIME) adds a statusbar message, MSG, to the
%  browser and starts a timer to remove it after TIME seconds.

%  Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc.


% add message
MSGID=h.addStatusMsg(msg);

% create timer for deletion
T = xregGui.getUITimer;
T.scheduleAt(time*1000, {@i_removemsg,h,MSGID});


function i_removemsg(src,evt,h,MSGID)
if ishandle(h) && h.GUIExists && ~mbcgui.util.isBeingDestroyed(h.Figure)
    h.removeStatusMsg(MSGID);
end