diff pyink/MBScene.py @ 1212:962a6fec2198

Set a label for every frameline
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 04 Jan 2011 12:46:47 +0800
parents 4bbad66f23b8
children 86428aa657ab
line wrap: on
line diff
--- a/pyink/MBScene.py	Tue Jan 04 12:03:02 2011 +0800
+++ b/pyink/MBScene.py	Tue Jan 04 12:46:47 2011 +0800
@@ -955,6 +955,16 @@
 		self.add_layer(layer_idx, child)
 		self.parse_layer(layer_idx)
 		self._add_frameline(layer_idx)
+		
+		layer = self._layers[layer_idx]
+		frameline = self._framelines[layer_idx]
+		try:
+		    label = layer.group.getAttribute('inkscape:label')
+		except:
+		    label = layer.group.getAttribute('id')
+		    pass
+		frameline.label.set_text(label)
+		
 		self._show_framelines()
 		pass
 	    
@@ -965,6 +975,14 @@
     def _add_frameline_for_layers(self):
 	for layer_idx in range(len(self._layers)):
 	    self._add_frameline(layer_idx)
+	    line = self._framelines[layer_idx]
+	    layer = self._layers[layer_idx]
+	    try:
+		label = layer.group.getAttribute('inkscape:label')
+	    except:
+		label = layer.group.getAttribute('id')
+		pass
+	    line.label.set_text(label)
 	    pass
 	pass