/[ascend]/branches/adrian/pygtk/canvas/contextmenutool.py
ViewVC logotype

Diff of /branches/adrian/pygtk/canvas/contextmenutool.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1945 by jpye, Thu Nov 6 08:54:02 2008 UTC revision 1969 by jpye, Tue Dec 2 07:40:59 2008 UTC
# Line 25  class ContextMenuTool(Tool): Line 25  class ContextMenuTool(Tool):
25              menurename.connect("activate",self.rename,context.view.hovered_item,window)              menurename.connect("activate",self.rename,context.view.hovered_item,window)
26              menu.add(menurename)              menu.add(menurename)
27              menudelete = gtk.MenuItem("_Delete",True);              menudelete = gtk.MenuItem("_Delete",True);
28              menudelete.connect("activate",self.delete,context.view)              menudelete.connect("activate",self.delete,context.view.hovered_item,context.view)
29              menu.add(menudelete)              menu.add(menudelete)
30              menu.show_all()                  menu.show_all()    
31              menu.popup( None, None, None, event.button, event.time)              menu.popup( None, None, None, event.button, event.time)
# Line 50  class ContextMenuTool(Tool): Line 50  class ContextMenuTool(Tool):
50                  bi.name = ent.get_text()                  bi.name = ent.get_text()
51              dia.destroy()              dia.destroy()
52    
53      def delete(self,widget,view):      def delete(self,widget,item,view):
54          print "DELETING OBJECT"          print "DELETING OBJECT"
55          # TODO: add undo handler          # TODO: add undo handler
56          view.canvas.remove(view.hovered_item)          view.canvas.remove(item)
57    

Legend:
Removed from v.1945  
changed lines
  Added in v.1969

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22