From d99a2f00ee056e3a73801fb3436ccbe84c647628 Mon Sep 17 00:00:00 2001 From: Claydough6 Date: Thu, 6 May 2021 00:04:12 -0400 Subject: [PATCH] Fixed bug with child not deleting correctly --- resolution_gui/clause_frame.py | 2 +- resolution_gui/resolution_canvas.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resolution_gui/clause_frame.py b/resolution_gui/clause_frame.py index c102f7b..487f909 100644 --- a/resolution_gui/clause_frame.py +++ b/resolution_gui/clause_frame.py @@ -13,7 +13,7 @@ def __init__(self, app, canvas, master=None, **kwargs): self.canvas = canvas self.parents = list() - self.child = None + self.child = list() self.premise_index = None self.state = None diff --git a/resolution_gui/resolution_canvas.py b/resolution_gui/resolution_canvas.py index ffbbd7e..e49906e 100644 --- a/resolution_gui/resolution_canvas.py +++ b/resolution_gui/resolution_canvas.py @@ -46,7 +46,7 @@ def kill_clause(self, *args): to_delete.append((start, end)) if end == selected: this = self.frames[start] - this.child = None + this.child.remove(end) # undraw the line to_delete.append((start, end)) self.delete(selected) @@ -114,16 +114,16 @@ def frame_click(self, frame_id): if clicked in this.parents: # remove the other from this parents this.parents.remove(clicked) - other.child = None + other.child.remove(this) # if no parents, update state if len(this.parents) == 0: this.state = None # undraw the line self.remove_line(clicked, selected) - elif len(this.parents) < 2 and other.child == None: + elif len(this.parents) < 2: # update the parents this.parents.append(clicked) - other.child = this + other.child.append(selected) # update the state to regualar clause this.state = "clause" # draw the line between the two