# HG changeset patch # User wycc # Date 1292637601 -28800 # Node ID 37a0f6ab2f9114ddd2e905aac47292a2807262b8 # Parent b65ac686a7c5c891397ef48afc4c06486119d35e Lock the UI from refreshing during the update procedure diff -r b65ac686a7c5 -r 37a0f6ab2f91 pyink/MBScene.py --- a/pyink/MBScene.py Sat Dec 18 09:00:55 2010 +0800 +++ b/pyink/MBScene.py Sat Dec 18 10:00:01 2010 +0800 @@ -83,7 +83,7 @@ if self.type == 'DOMSubtreeModified': self.func(node) def notifyAttributeChanged(self,node, name, old_value, new_value): - print 'attr' + print 'attr',node,name,old_value,new_value if self.type == 'DOMAttrModified': self.func(node,name) @@ -131,6 +131,7 @@ self.last_update = None pybInkscape.inkscape.connect('change_selection', self.show_selection) self.last_select = None + self.lockui=False pass def startPolling(self): @@ -283,7 +284,7 @@ elif node.name() == 'svg:g': oldscene = None #obs = LayerAttributeWatcher(self) - addEventListener(doc,'DOMAttrModified',self.updateUI,None) + #addEventListener(doc,'DOMAttrModified',self.updateUI,None) #node.addObserver(obs) lyobj = Layer(node) self.layers.append(lyobj) @@ -822,7 +823,9 @@ self.last_line = line self.last_frame = frame self.last_line.active_frame(frame) + self.lockui = True self.doEditScene(frame) + self.lockui = False def _remove_active_frame(self,widget,event): @@ -1054,6 +1057,11 @@ pass def updateUI(self,node=None,arg=None): + if self.lockui: return + self.lockui = True + self._updateUI() + self.lockui = False + def _updateUI(self,node=None,arg=None): if self.last_update!= None: glib.source_remove(self.last_update) self.last_update = glib.timeout_add(300,self.show)