Skip to content
Advertisement

How to draw lines between widgets in Tkinter?

I have written a script that takes in a file of the format

JavaScript

Where each line in the list represents a ‘parent’ node and its list of ‘child’ nodes. So far I have written a script such that these nodes are printed out like a tree, and now I want to try to draw lines/arrows between these nodes. My current python script is as follows:

JavaScript

I’ve tried using a canvas to do a create_line but was unsuccessful with this. Maybe I’m just missing something obvious, but does anyone have any advice on how to approach this?

Advertisement

Answer

Update: I fixed this issue! It turns out I just needed to scale the canvas to be the same size as my window.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement