-
Notifications
You must be signed in to change notification settings - Fork 24
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
[FEATURE] provide access to callee in cmd event #48
Comments
There are two ways to add callback functions
The latter does not pass an event object to the callback and that's just how |
Couldn't the framework just add a 2nd paramater automatically?
this would be backward compatible with existing code (not breaking event parameter), otherwise it is just another thing that we have to keep in sync with the UI. or a wrapper object into event parameter that contains the instance.
|
Overloading 'command' wouldn't be strange to tkinter, see the callback of r scrollbar, it can have 2 or 3 parameters depending how you clicked it. |
I have added a way to get the widget passed as an argument to both the command and Event pane methods. Given a function/method shown below: def ui_evt_save(callee):
print(callee) you can set the command to def ui_evt_save(callee, arg1, arg2):
print(callee, arg1, arg2) # <widget> 20 50 |
Master head has a msg:
also when I try to open my xml in it, it just exits without reason. but from code I can still open the xml So I can't test it yet. |
I hope you were not using any customtkinter stuff. It is super buggy. Can you send over the offending XML. |
Don't even know what that is :D You could keep a collection of xml files and run them from cli to see if they still work with the new version, like a regression test. |
I already have very comprehensive tests so I can catch any major regressions. The XML seems to be working on my end. What exactly is exiting without reason? |
it simply exits, on console it waits an extra enter from me, Something has to do with the themes, after I changed every
it opens. Although I still have tkinter.ttk. left. so this one works for me I'm on Windows 10 (don't judge). |
I am unable to reproduce the issue. Might be related to the fact that you are installing the master branch from git so the entrypoints are not being configured properly. For now, just try to test the callback feature. |
Weird, it also works on Windows 7. |
callee works great! Thank you!
|
I define a simple command function
def ui_evt_save(event=None):
wire it in into a button,
but when it triggers the event parameter is still None,
I would need a way to get the caller instance (e.g. multiple buttons wired into one cmd handler)
The text was updated successfully, but these errors were encountered: