Author: bugman Date: Wed Jul 6 19:01:10 2011 New Revision: 13463 URL: http://svn.gna.org/viewcvs/relax?rev=13463&view=rev Log: The observer object is called by the spin viewer tree right click menu items. The right click menu items which call user functions now call self.gui.user_functions.notify_observers() to update all GUI elements. Modified: branches/gui_testing/gui/spin_viewer/tree.py Modified: branches/gui_testing/gui/spin_viewer/tree.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/spin_viewer/tree.py?rev=13463&r1=13462&r2=13463&view=diff ============================================================================== --- branches/gui_testing/gui/spin_viewer/tree.py (original) +++ branches/gui_testing/gui/spin_viewer/tree.py Wed Jul 6 19:01:10 2011 @@ -204,8 +204,8 @@ # Delete the molecule. self.gui.user_functions.interpreter.molecule.delete(gui_to_str(self.info['id'])) - # Refresh the whole spin viewer. - self.gui.spin_viewer.refresh() + # Notify all observers that a user function has completed. + self.gui.user_functions.notify_observers() def delete_residue(self, event): @@ -223,8 +223,8 @@ # Delete the residue. self.gui.user_functions.interpreter.residue.delete(gui_to_str(self.info['id'])) - # Refresh the whole spin viewer. - self.gui.spin_viewer.refresh() + # Notify all observers that a user function has completed. + self.gui.user_functions.notify_observers() def delete_spin(self, event): @@ -242,8 +242,8 @@ # Delete the spin. self.gui.user_functions.interpreter.spin.delete(gui_to_str(self.info['id'])) - # Refresh the whole spin viewer. - self.gui.spin_viewer.refresh() + # Notify all observers that a user function has completed. + self.gui.user_functions.notify_observers() def deselect_molecule(self, event): @@ -261,8 +261,8 @@ # Deselect the molecule. self.gui.user_functions.interpreter.deselect.spin(spin_id=gui_to_str(self.info['id']), change_all=False) - # Refresh the whole spin viewer. - self.gui.spin_viewer.refresh() + # Notify all observers that a user function has completed. + self.gui.user_functions.notify_observers() def deselect_residue(self, event): @@ -280,8 +280,8 @@ # Deselect the residue. self.gui.user_functions.interpreter.deselect.spin(spin_id=gui_to_str(self.info['id']), change_all=False) - # Refresh the whole spin viewer. - self.gui.spin_viewer.refresh() + # Notify all observers that a user function has completed. + self.gui.user_functions.notify_observers() def deselect_spin(self, event): @@ -294,8 +294,8 @@ # Deselect the spin. self.gui.user_functions.interpreter.deselect.spin(spin_id=gui_to_str(self.info['id']), change_all=False) - # Refresh the whole spin viewer. - self.gui.spin_viewer.refresh() + # Notify all observers that a user function has completed. + self.gui.user_functions.notify_observers() def get_info(self): @@ -509,8 +509,8 @@ # Select the molecule. self.gui.user_functions.interpreter.select.spin(spin_id=gui_to_str(self.info['id']), change_all=False) - # Refresh the whole spin viewer. - self.gui.spin_viewer.refresh() + # Notify all observers that a user function has completed. + self.gui.user_functions.notify_observers() def select_residue(self, event): @@ -528,8 +528,8 @@ # Select the residue. self.gui.user_functions.interpreter.select.spin(spin_id=gui_to_str(self.info['id']), change_all=False) - # Refresh the whole spin viewer. - self.gui.spin_viewer.refresh() + # Notify all observers that a user function has completed. + self.gui.user_functions.notify_observers() def select_spin(self, event): @@ -542,8 +542,8 @@ # Select the spin. self.gui.user_functions.interpreter.select.spin(spin_id=gui_to_str(self.info['id']), change_all=False) - # Refresh the whole spin viewer. - self.gui.spin_viewer.refresh() + # Notify all observers that a user function has completed. + self.gui.user_functions.notify_observers() def set_bitmap_mol(self, mol_branch_id, select=True):