Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
Hi mate, your code is getting quite large and very difficult to understand, because it is rather unstructured and messy :( I am again a newbie on tkinter, but most sources and examples I have seen, recommend an object oriented approach and this will become harder to do later, when you add even more functionality. So first thing I suggest is refactor your tkinter app into a class, and organize the self-contained pieces into functions. (You have some of those already but they are just all over the place.) https://stackoverflow.com/questions/17466561/best-way-to-structure-a-tkinter-application Then about the sliders. It seems you can add a command property to the Scale object, similar to what you have on the button. But what looks even better is binding a "<ButtonRelease-1>" event to the Scale, so it would only activate when you actually release the mouse button. It's explained here: https://stackoverflow.com/questions/3966303/tkinter-slider-how-to-trigger-the-event-only-when-the-iteraction-is-complete I was able to test your program and I found that every time I press the send button, actually a new plot is generated in a separate window. I think what you really want to do is update the existing graph and change the arrows, instead of drawing a new one. I am not sure (yet) how to do it, but I have a feeling that OOP approach would also be more helpful here. Sorry but this time that's all I can do for you, no time to fully understand and refactor your code :(
3rd Mar 2019, 8:16 AM
Tibor Santa
Tibor Santa - avatar