Home > wafo > misc > choicex.m

choicex

PURPOSE ^

Close a list of choices.

SYNOPSIS ^

choicex(name)

DESCRIPTION ^

 CHOICEX Close a list of choices. 
    CHOICEX('NAME') closes the choice window with name 'NAME' and 
    removes this name from the registration list. 
    CHOICEX is used as the callback for the Close button in a choice list 
    created using CHOICES. 
  
    See also CHOICES.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function choicex(name) 
002 %CHOICEX Close a list of choices. 
003 %   CHOICEX('NAME') closes the choice window with name 'NAME' and 
004 %   removes this name from the registration list. 
005 %   CHOICEX is used as the callback for the Close button in a choice list 
006 %   created using CHOICES. 
007 % 
008 %   See also CHOICES. 
009  
010 %%%   Copyright 1984-2000 The MathWorks, Inc.  
011 %%%   $Revision: 5.6 $  $Date: 2000/06/01 03:16:23 $ 
012  
013 global CHOICELIST 
014 global CHOICEHANDLES 
015 if ~isstr(name) 
016     error('Requires string input argument.') 
017 end 
018 name = deblank(name); 
019 % set up link to global choice names and handles and add or delete 
020 % these in lock-step 
021 match = 0; 
022 for i = 1:size(CHOICELIST,1) 
023     if strcmp(name,deblank(CHOICELIST(i,:))) 
024         match = i; 
025         break; 
026     end 
027 end 
028 if match == 0   % no match 
029     return 
030 else 
031     delete(CHOICEHANDLES(match)); 
032     CHOICEHANDLES(match) = []; 
033     CHOICELIST(match,:) = []; 
034     if (match-1) > 0 
035         set(CHOICEHANDLES(match-1),'visible','on') 
036     end 
037 end 
038

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group


Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003