To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

The primary repository for this project is hosted at git://github.com/rmeddis/MAP.git .
This repository is a read-only copy which is updated automatically every hour.

Statistics Download as Zip
| Branch: | Revision:

root / multithreshold 1.46 / addToMsg.m @ 38:c2204b18f4a2

History | View | Annotate | Download (890 Bytes)

1
% ---------------------------------------------------------- addToMsg
2
function addToMsg(message,append, warning)
3
% 'message' is posted to the message board
4
% if append==1, message is appended to the current message
5
global experiment expGUIhandles
6

    
7
if nargin<3
8
    % this is not a warning screen
9
    warning=0;
10
end
11

    
12
if append
13
msg=get(expGUIhandles.textMSG,'string');
14
[r c]=size(msg);
15
    if length(message)<=c
16
        y=[message blanks(c-length(message))];
17
        msg(r+1,:)=y;
18
    else
19
        msg=message;
20
    end
21
else
22
    msg=message;
23
end
24

    
25
try
26
    set(expGUIhandles.textMSG,'string', msg,'fontSize', experiment.msgFontSize)
27
    if warning
28
        % flash red to signal a warning
29
        set(expGUIhandles.textMSG,'backgroundcolor','r', 'ForegroundColor', 'w'	)
30
    else
31
        set(expGUIhandles.textMSG,'backgroundcolor','w', 'ForegroundColor', 'b')
32
    end
33
catch
34
    error(message)
35
end