Fix bug while adding new value to enumerated datatype list of values
authorlaurent
Tue, 31 Jan 2012 23:58:16 +0100
changeset 636 44978a2b9703
parent 635 dbcb8e2d2730
child 637 d8fe5a0f5403
Fix bug while adding new value to enumerated datatype list of values
DataTypeEditor.py
--- a/DataTypeEditor.py	Tue Jan 31 23:38:12 2012 +0100
+++ b/DataTypeEditor.py	Tue Jan 31 23:58:16 2012 +0100
@@ -583,8 +583,8 @@
         self.Initializing = False
     
     def OnDerivationTypeChanged(self, event):
-        self.RefreshDisplayedInfos()
-        self.RefreshTypeInfos()
+        wx.CallAfter(self.RefreshDisplayedInfos)
+        wx.CallAfter(self.RefreshTypeInfos)
         event.Skip()
 
     def OnReturnKeyPressed(self, event):
@@ -633,7 +633,7 @@
                 message.Destroy()
             else:
                 initial_selected = None
-                if self.EnumeratedInitialValue.GetStringSelection() == values[index]:
+                if index < len(values) and self.EnumeratedInitialValue.GetStringSelection() == values[index]:
                     initial_selected = text
                 wx.CallAfter(self.RefreshEnumeratedValues, initial_selected)
                 wx.CallAfter(self.RefreshTypeInfos)