Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@repogui/cb_workspaceObjsList.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,35 @@ +% CB_WORKSPACEOBJSLIST callback for workspace object list. +% +% M Hewitson 22-09-08 +% +% $Id: cb_workspaceObjsList.m,v 1.2 2009/02/18 18:17:26 nicola Exp $ +% +function cb_workspaceObjsList(varargin) + + % Handles + myh = varargin{1}; + mainfig = varargin{end}; + + % get the selected line + val = get(myh, 'Value'); + if length(val) == 1 + lines = get(myh, 'String'); + objname = deblank(strtok(lines{val})); + + cmd = sprintf('obj = evalin(''base'', ''%s'');', objname); + eval(cmd); + + % obj + objtxt = display(obj); + else + objtxt = ''; + end + + st = ''; + for j=1:length(objtxt) + st = [st sprintf('%s\n', objtxt{j})]; + end + + % set objDisplay Txt + set(myh, 'TooltipString', st); +end