diff pyink/MBScene.py @ 1328:407f321f0d7c

Add a svg:use after transform a group to a component
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 31 Jan 2011 12:47:49 +0800
parents e155064f6c7e
children 2b051e474b0f
line wrap: on
line diff
--- a/pyink/MBScene.py	Sun Jan 30 23:04:06 2011 +0800
+++ b/pyink/MBScene.py	Mon Jan 31 12:47:49 2011 +0800
@@ -403,10 +403,19 @@
     ## \brief To handle context menu event.
     #
     def do_make_component_from_group(self, node):
+	node_parent_group = node.parent()
+	
 	comp_name = 'Component ' + node.getAttribute('id')
 	self._domviewui.add_component_from_group(comp_name, node)
+	
+	self._domviewui.link_to_component(comp_name, node_parent_group)
 	pass
 
+    ## \brief Add menu item to context menu.
+    #
+    # This method is called by pyink.pyink_context_menu() to notify the
+    # creation of context menu for a node.
+    #
     def context_menu(self, spitem, menu_factory):
 	node = spitem.repr
 	if node.name() != 'svg:g':