Home > functions > gui > batch > batch_list > vb_batch_list_put_log.m

vb_batch_list_put_log

PURPOSE ^

Add log to gui.

SYNOPSIS ^

function vb_batch_list_put_log(fig, text)

DESCRIPTION ^

 Add log to gui.
 Carriage return is added to end automatically.
 [USAGE]
    vb_batch_list_put_log(<fig>, <text>);
 [IN]   
     fig : figure handle of vb_batch_list gui
    text : text to be added to log window.
 [OUT]
    none

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function vb_batch_list_put_log(fig, text)
0002 % Add log to gui.
0003 % Carriage return is added to end automatically.
0004 % [USAGE]
0005 %    vb_batch_list_put_log(<fig>, <text>);
0006 % [IN]
0007 %     fig : figure handle of vb_batch_list gui
0008 %    text : text to be added to log window.
0009 % [OUT]
0010 %    none
0011 %
0012 % Copyright (C) 2011, ATR All Rights Reserved.
0013 % License : New BSD License(see VBMEG_LICENSE.txt)
0014 
0015 %
0016 % --- Previous check
0017 %
0018 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0019     error('invalid figure handle is specified.');
0020 end
0021 if ~exist('text', 'var') || ~ischar(text)
0022     error('invalid text is handed.');
0023 end
0024 
0025 %
0026 % --- Main Procedure
0027 %
0028 data = guidata(fig);
0029 
0030 past = get(data.H.msg_edit, 'String');
0031 if isempty(past)
0032     str{1} = text;
0033 else
0034     str = cellstr(past);
0035     str{length(str)+1} = text;
0036 end
0037 set(data.H.msg_edit, 'String', str);
0038 drawnow; % This command activate the change of listboxtop property.
0039 set(data.H.msg_edit, 'listboxtop', length(str));

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005