-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added UI edit events, bugfixes #171
Conversation
Hey, Thanks for the bugfixes and suggestion. I agree and think that it is currently awkward to monitor every sheet modified event, having to create extra_bindings() for everything I am thinking I might add some information on what sort of modification as well |
I may or may not plug this into the existing |
I decided that I will add both something for Thanks again! |
Agreed. tkinter does not handle binding data to custom virtual events very well. There are ways around it, but it is fairly hacky, so we will need to provide some custom functions for the user to use to unpack the event data. I'll attach the way I handle passing data through custom virtual events in my apps. I think it would be useful pass data the following inside our event.
|
Thanks for the additional info and code, I will get back to you about it soon |
What I've done in
It'll send the sheet object and the data dict I think this is okay but let me know if not |
Cool, lo he estado usando y me esta funcionando esa solucion... |
Hola, me funciona hasta el momento, es una buena opcio que se pueda hacer calculos. |
Hello!
I have added events for external listeners so that programs know when changes are being made to the sheet via the UI. This can be useful in cases where parts of the sheet or program need to be updated dynamically based on what is on the sheet without comparing the sheet data every mainloop iteration. Each edit to the table should produce one event that occurs after tksheet has made all the internal changes to its data.
Note that edits to the sheet data through code should produce no event, this is because the code should know if it is making changes and it is easy to create infinite loops of editing events if the code changes to sheet data produce events which spawn more changes.
This is somewhat a response to issue #170. I think this is a better way for users to handle calculated cells going forward as the actual logic sits outside the widget itself.
Here is a small code example where column C is the sum of A and B: