pygui: fixed interface creation after deletion, fixed issue reusing deleted subnets

This commit is contained in:
Blake Harnden 2020-05-16 23:35:19 -07:00
parent 91220078f1
commit 06e3d84862
5 changed files with 33 additions and 30 deletions

View file

@ -55,7 +55,7 @@ class CanvasNode:
)
self.tooltip = CanvasTooltip(self.canvas)
self.edges = set()
self.interfaces = []
self.interfaces = {}
self.wireless_edges = set()
self.antennas = []
self.antenna_images = {}
@ -70,6 +70,12 @@ class CanvasNode:
self.context = tk.Menu(self.canvas)
themes.style_menu(self.context)
def next_interface_id(self) -> int:
i = 0
while i in self.interfaces:
i += 1
return i
def setup_bindings(self):
self.canvas.tag_bind(self.id, "<Double-Button-1>", self.double_click)
self.canvas.tag_bind(self.id, "<Enter>", self.on_enter)