# HG changeset patch
# User Laurent Bessard
# Date 1370850864 -7200
# Node ID 24577755485d6f41227d22d2cc31ff0be12d8d0c
# Parent  0c8b8ef9559ba26d2c2f8ae6be17b3e29c2c6e84
Fixed bug with InstanceChoice values in PouInstanceVariablesPanel

diff -r 0c8b8ef9559b -r 24577755485d 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: