Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def copy(self):
- def get_descendants(_node):
- descendants = []
- _children = self.get_children(_node)
- for _child in _children:
- descendants.append(_child)
- _nodes = self.get_children(_child)
- if _nodes:
- descendants += self.get_descendants(_child)
- return descendants
- self.was_cut = False
- self.tags_remove_all('copy', 'selected')
- self.refresh_tags()
- self.popup.enable_items(['paste'])
- self.pointer_x, self.pointer_y = self.winfo_toplevel().winfo_pointerxy()
- items = []
- selections = sorted(list(self.selection()))
- for node in selections:
- item = self.item(node)
- _type = item['values'][0]
- _open = item['open']
- items.append(node)
- if not _open and _type == 'Menu':
- items += get_descendants(node)
- for item in items:
- self.tags_add(item, ['copy', 'selected'])
- self.tags_remove(item, ['odd', 'even'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement