Mercurial > hg > map
comparison Copy_of_multithreshold 1.46/addToMsg.m @ 28:02aa9826efe0
mainly multiThreshold
author | Ray Meddis <rmeddis@essex.ac.uk> |
---|---|
date | Fri, 01 Jul 2011 12:59:47 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
27:d4a7675b0413 | 28:02aa9826efe0 |
---|---|
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 |