mailr14638 - in /1.3/gui: relax_gui.py results_viewer.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 14, 2011 - 18:34:
Author: bugman
Date: Wed Sep 14 18:34:27 2011
New Revision: 14638

URL: http://svn.gna.org/viewcvs/relax?rev=14638&view=rev
Log:
Removed all usage of self.gui from the results viewer window.


Modified:
    1.3/gui/relax_gui.py
    1.3/gui/results_viewer.py

Modified: 1.3/gui/relax_gui.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/relax_gui.py?rev=14638&r1=14637&r2=14638&view=diff
==============================================================================
--- 1.3/gui/relax_gui.py (original)
+++ 1.3/gui/relax_gui.py Wed Sep 14 18:34:27 2011
@@ -475,7 +475,7 @@
 
         # Create the results viewer window if needed.
         if not hasattr(self, 'results_viewer'):
-            self.results_viewer = Results_viewer(gui=self)
+            self.results_viewer = Results_viewer(self)
 
         # Open the window.
         if status.show_gui and not self.results_viewer.IsShown():

Modified: 1.3/gui/results_viewer.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/results_viewer.py?rev=14638&r1=14637&r2=14638&view=diff
==============================================================================
--- 1.3/gui/results_viewer.py (original)
+++ 1.3/gui/results_viewer.py Wed Sep 14 18:34:27 2011
@@ -37,6 +37,7 @@
 # relax GUI module imports.
 from gui.fonts import font
 from gui.icons import relax_icons
+from gui.interpreter import Interpreter; interpreter = Interpreter()
 from gui.misc import add_border, gui_to_str, open_file, str_to_gui
 from gui.paths import icon_22x22
 from gui.user_functions import User_functions; user_functions = 
User_functions()
@@ -49,18 +50,15 @@
     border = 10
     size = (800, 400)
 
-    def __init__(self, gui):
+    def __init__(self, parent):
         """Build the results frame.
 
-        @param gui:                 The main GUI class.
-        @type gui:                  gui.relax_gui.Main instance
-        """
-
-        # Store the main class.
-        self.gui = gui
+        @param parent:  The parent wx object.
+        @type parent:   wx object
+        """
 
         # Initialise the base frame.
-        wx.Frame.__init__(self, parent=gui, style=wx.DEFAULT_FRAME_STYLE)
+        wx.Frame.__init__(self, parent=parent, style=wx.DEFAULT_FRAME_STYLE)
 
         # Set up the window icon.
         self.SetIcons(relax_icons)
@@ -96,7 +94,7 @@
         self.button_open.SetBitmapLabel(wx.Bitmap(icon_22x22.document_open, 
wx.BITMAP_TYPE_ANY))
         self.button_open.SetFont(font.normal)
         self.button_open.SetMinSize((103, 33))
-        self.gui.Bind(wx.EVT_BUTTON, self.open_result_file, self.button_open)
+        self.Bind(wx.EVT_BUTTON, self.open_result_file, self.button_open)
         box_centre.Add(self.button_open, 0, 
wx.ALIGN_RIGHT|wx.ADJUST_MINSIZE, 5)
 
         # Relayout the main panel.
@@ -180,7 +178,7 @@
         # Bind events.
         self.file_list.Bind(wx.EVT_SIZE, self.resize)
         if fn:
-            self.gui.Bind(wx.EVT_LISTBOX_DCLICK, fn, self.file_list)
+            self.Bind(wx.EVT_LISTBOX_DCLICK, fn, self.file_list)
 
 
     def build_pipe_sel(self, box):
@@ -262,9 +260,9 @@
 
             # Diffusion tensor PDB.
             elif type == 'diff_tensor_pdb':
-                self.gui.interpreter.queue('pymol.view')
-                self.gui.interpreter.queue('pymol.cartoon')
-                self.gui.interpreter.queue('pymol.tensor_pdb', file=file)
+                interpreter.queue('pymol.view')
+                interpreter.queue('pymol.cartoon')
+                interpreter.queue('pymol.tensor_pdb', file=file)
 
             # A special table.
             elif type == 'Table_of_Results':
@@ -343,8 +341,8 @@
             return
 
         # Switch data pipes.
-        self.gui.interpreter.queue('pipe.switch', pipe)
-        self.gui.interpreter.flush()
+        interpreter.queue('pipe.switch', pipe)
+        interpreter.flush()
 
         # Update the window.
         self.refresh()




Related Messages


Powered by MHonArc, Updated Wed Sep 14 19:00:02 2011