controls/PouInstanceVariablesPanel.py
changeset 1238 24577755485d
parent 1233 5e6d0969bb5d
child 1277 358db9d64aa1
--- a/controls/PouInstanceVariablesPanel.py	Mon Jun 10 01:15:39 2013 +0200
+++ b/controls/PouInstanceVariablesPanel.py	Mon Jun 10 09:54:24 2013 +0200
@@ -141,8 +141,6 @@
     def RefreshView(self):
         self.Freeze()
         self.VariablesList.DeleteAllItems()
-        self.InstanceChoice.Clear()
-        self.InstanceChoice.SetValue("")
         
         if self.Controller is not None and self.PouTagName is not None:
             self.PouInfos = self.Controller.GetPouVariables(self.PouTagName, self.Debug)
@@ -202,13 +200,14 @@
                 self.VariablesList.SetItemImage(item, self.ParentWindow.GetTreeImage(var_infos["class"]))
                 self.VariablesList.SetPyData(item, var_infos)
             
-            self.RefreshInstanceChoice()
-        
+        self.RefreshInstanceChoice()
         self.RefreshButtons()
         
         self.Thaw()
     
     def RefreshInstanceChoice(self):
+        self.InstanceChoice.Clear()
+        self.InstanceChoice.SetValue("")
         if self.Controller is not None and self.PouInfos is not None:
             instances = self.Controller.SearchPouInstances(self.PouTagName, self.Debug)
             for instance in instances: