comparison m-toolbox/classes/@repogui/cb_workspaceObjsList.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % CB_WORKSPACEOBJSLIST callback for workspace object list.
2 %
3 % M Hewitson 22-09-08
4 %
5 % $Id: cb_workspaceObjsList.m,v 1.2 2009/02/18 18:17:26 nicola Exp $
6 %
7 function cb_workspaceObjsList(varargin)
8
9 % Handles
10 myh = varargin{1};
11 mainfig = varargin{end};
12
13 % get the selected line
14 val = get(myh, 'Value');
15 if length(val) == 1
16 lines = get(myh, 'String');
17 objname = deblank(strtok(lines{val}));
18
19 cmd = sprintf('obj = evalin(''base'', ''%s'');', objname);
20 eval(cmd);
21
22 % obj
23 objtxt = display(obj);
24 else
25 objtxt = '';
26 end
27
28 st = '';
29 for j=1:length(objtxt)
30 st = [st sprintf('%s\n', objtxt{j})];
31 end
32
33 % set objDisplay Txt
34 set(myh, 'TooltipString', st);
35 end