comparison 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
comparison
equal deleted inserted replaced
1211:4bbad66f23b8 1212:962a6fec2198
953 child_id = child.getAttribute('id') 953 child_id = child.getAttribute('id')
954 if (not layer) or layer_group_id != child_id: 954 if (not layer) or layer_group_id != child_id:
955 self.add_layer(layer_idx, child) 955 self.add_layer(layer_idx, child)
956 self.parse_layer(layer_idx) 956 self.parse_layer(layer_idx)
957 self._add_frameline(layer_idx) 957 self._add_frameline(layer_idx)
958
959 layer = self._layers[layer_idx]
960 frameline = self._framelines[layer_idx]
961 try:
962 label = layer.group.getAttribute('inkscape:label')
963 except:
964 label = layer.group.getAttribute('id')
965 pass
966 frameline.label.set_text(label)
967
958 self._show_framelines() 968 self._show_framelines()
959 pass 969 pass
960 970
961 layer_idx = layer_idx + 1 971 layer_idx = layer_idx + 1
962 pass 972 pass
963 pass 973 pass
964 974
965 def _add_frameline_for_layers(self): 975 def _add_frameline_for_layers(self):
966 for layer_idx in range(len(self._layers)): 976 for layer_idx in range(len(self._layers)):
967 self._add_frameline(layer_idx) 977 self._add_frameline(layer_idx)
978 line = self._framelines[layer_idx]
979 layer = self._layers[layer_idx]
980 try:
981 label = layer.group.getAttribute('inkscape:label')
982 except:
983 label = layer.group.getAttribute('id')
984 pass
985 line.label.set_text(label)
968 pass 986 pass
969 pass 987 pass
970 988
971 def duplicateKeyScene(self): 989 def duplicateKeyScene(self):
972 # Search for the current scene 990 # Search for the current scene