Fixed bug with InstanceChoice values in PouInstanceVariablesPanel
authorLaurent Bessard
Mon, 10 Jun 2013 09:54:24 +0200
changeset 1238 24577755485d
parent 1237 0c8b8ef9559b
child 1239 d1f6ea56555d
Fixed bug with InstanceChoice values in PouInstanceVariablesPanel
controls/PouInstanceVariablesPanel.py
--- 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: