[Skencil-commits] r720 - skencil/branches/skencil-0.6/src/Sketch/UI

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Sep 22 15:42:14 CEST 2010


Author: igor_n
Date: 2010-09-22 15:42:14 +0200 (Wed, 22 Sep 2010)
New Revision: 720

Modified:
   skencil/branches/skencil-0.6/src/Sketch/UI/tkext.py
Log:
menu rebuild issue fix

Modified: skencil/branches/skencil-0.6/src/Sketch/UI/tkext.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/UI/tkext.py	2010-09-22 13:19:07 UTC (rev 719)
+++ skencil/branches/skencil-0.6/src/Sketch/UI/tkext.py	2010-09-22 13:42:14 UTC (rev 720)
@@ -363,23 +363,25 @@
 		entry.AddToMenu(None)
 
     def RebuildMenu(self):
-	if self.entries is not None:
-	    self.menu.delete(0, END)
-	if self.rebuild_func is not None:
-	    try:
-		self.entries = self.rebuild_func()
-	    except:
-		warn_tb(INTERNAL, 'Trying to rebuild menu')
-	self.__build_menu()
+        if self.entries is not None:
+#        self.menu.delete(0, END)
+            self.menu.tk.call(self.menu._w, 'delete', 0, END)
+        if self.rebuild_func is not None:
+            try:
+                self.entries = self.rebuild_func()
+            except:
+                warn_tb(INTERNAL, 'Trying to rebuild menu')
+        self.__build_menu()
         self.Update()
 
     def SetEntries(self, entries):
-	if self.entries is not None:
-	    self.menu.delete(0, END)
-	    for entry in self.entries:
-		entry.clean_up()
-	self.entries = entries
-	self.__build_menu()
+        if self.entries is not None:
+#        self.menu.delete(0, END)
+            self.menu.tk.call(self.menu._w, 'delete', 0, END)
+            for entry in self.entries:
+                entry.clean_up()
+        self.entries = entries
+        self.__build_menu()
 
     def Popup(self, x, y):
 	self.menu.tk_popup(x, y)



More information about the Skencil-commits mailing list