% Copyright (c) 2002 by Tobin Fricke <tobin@splorg.org>

% make up a sort of crosshairs icon

icon = ...
[ 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 ; ...
  0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 ; ...
  0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 ; ...
  0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 ; ...
  0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 ; ...
  0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 ; ...
  0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 ; ...
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ; ...
  0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 ; ...
  0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 ; ...
  0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 ; ...
  0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 ; ...
  0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 ; ...
  0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 ; ...
  0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 ];

% Use "NaN" for transparent; 0 for black.

icon(find(icon == 0)) = NaN;
icon(find(icon == 1)) = 0;

% This follows the technique explained by  Perttu Ranta-aho
% http://groups.google.com/groups?as_umsgid=lp8z7tf7ds.fsf%40mela16.uku.fi

f = gcf,

h = findall(f,'tooltip','Rotate 3D'),

pr_h = get(h,'Parent'),

own_h = uitoggletool('Parent',pr_h,'Separator','off',... 
                  'Tooltip','Pan',...
                   'Clicked','msgbox(''It works'','''',''warn'')',...
                   'cdata',repmat(icon,[1 1 3]));



   
