[chronojump] GenericWindow fix sometimes have double combo: id:name



commit 00edde2e1cc0b2b6695304e5fccd40c498367df5
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Sep 16 16:42:29 2019 +0200

    GenericWindow fix sometimes have double combo: id:name

 src/gui/genericWindow.cs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/gui/genericWindow.cs b/src/gui/genericWindow.cs
index 4e9b8afb..cd78189d 100644
--- a/src/gui/genericWindow.cs
+++ b/src/gui/genericWindow.cs
@@ -399,7 +399,12 @@ public class GenericWindow
        public void SetComboValues(string [] values, string current) {
                combo = ComboBox.NewText ();
                UtilGtk.ComboUpdate(combo, values, "");
-               
+
+               //if there hbox already has a combo (window has not been properly destroyed)
+               //remove that combo (to not have two combos)
+               if(hbox_combo.Children.Length > 0)
+                       hbox_combo.Remove(combo);
+
                hbox_combo.PackStart(combo, true, true, 0);
                hbox_combo.ShowAll();
                combo.Sensitive = true;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]