diff m-toolbox/classes/@LTPDAprefs/cb_guiClosed.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children ce4df2e95a55
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/@LTPDAprefs/cb_guiClosed.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,41 @@
+% cb_guiClosed callback for closing the LTPDAprefs GUI
+%
+% Parameters:
+%       first  - LTPDAprefs object
+%       second - Source object (here: java LTPDAPrefsGui)
+%       third  - Event Object (here: WindowEvent)
+%
+% Version:
+%     $Id: cb_guiClosed.m,v 1.4 2011/04/27 12:45:49 hewitson Exp $
+%
+
+function cb_guiClosed(varargin)
+  disp('*** Goodbye from LTPDAprefs');
+  ltpdaPrefs = varargin{1};
+  
+  if ~isempty(ltpdaPrefs) && isvalid(ltpdaPrefs)
+%     fprintf(2, 'deleting handles\n');
+    %--- called when window is closed
+    h = handle(ltpdaPrefs.gui, 'callbackproperties');
+    set(h, 'WindowClosedCallback', []);
+    %--- Add extension path button
+    h = handle(ltpdaPrefs.gui.getPrefsTabPane().getExtensionsPanel().getAddPathBtn(), 'callbackproperties');
+    set(h, 'ActionPerformedCallback', []);
+    %--- Remove extension path button
+    h = handle(ltpdaPrefs.gui.getPrefsTabPane().getExtensionsPanel().getRemovePathBtn(), 'callbackproperties');
+    set(h, 'ActionPerformedCallback', []);
+    %--- Plot preferences changed
+    h = handle(ltpdaPrefs.gui.getPrefs().getPlotPrefs(), 'callbackproperties');
+    set(h, 'PropertyChangeCallback', []);
+        
+    ltpdaPrefs.gui.setPrefs([]);
+    
+    %--- It is also necessary to destroy the GUI with the destructor 'delete'
+    delete(ltpdaPrefs);
+    
+  end
+  
+  java.lang.System.gc
+  clear();
+  
+end