Skip to content

Commit

Permalink
allow backspace/delete to be used interchangeably in gui
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzoic committed Oct 31, 2023
1 parent 25455c8 commit d2fcd74
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions countess/gui/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def __init__(self, canvas, graph, node_select_callback):
self.canvas.bind("<Motion>", self.on_canvas_motion)
self.canvas.bind("<Leave>", self.on_canvas_leave)
self.canvas.bind("<Key-Delete>", self.on_canvas_delete)
self.canvas.bind("<Key-BackSpace>", self.on_canvas_delete)

def label_for_node(self, node):
label = DraggableLabel(self.canvas, text=node.name, wraplength=125, cursor="hand1", takefocus=True)
Expand All @@ -304,6 +305,7 @@ def label_for_node(self, node):
label.bind("<Configure>", partial(self.on_configure, node, label), add=True)
label.bind("<<GhostRelease>>", partial(self.on_ghost_release, node), add=True)
label.bind("<Key-Delete>", partial(self.on_delete, node), add=True)
label.bind("<Key-BackSpace>", partial(self.on_delete, node), add=True)
label.bind("<Enter>", partial(self.on_enter, node), add=True)
label.bind("<Leave>", partial(self.on_leave, node), add=True)

Expand Down

0 comments on commit d2fcd74

Please sign in to comment.