Uh oh!
There was an error while loading. Please reload this page.
gh-47655: Add support for user data of Tk virtual events to tkinter - #7142
Conversation
the-knights-who-say-ni
commented
May 27, 2018
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. When your account is ready, please add a comment in this pull request Thanks again to your contribution and we look forward to looking at it! |
mkiever
commented
Jun 8, 2018
I see a "Contributor Form Received: Yes" now on my account on bpo. So CLA has arrived. |
@the-knights-who-say-ni , what is missing? Why it is not accepted yet?
Those erros are not related to tkinter |
aleroddepaz
commented
Apr 30, 2022
I have not seen any news about this issue after the migration, but it looks like this is the most complete patch. @serhiy-storchaka could anything else be done to help with this review? |
This PR is stale because it has been open for 30 days with no activity. |
Uh oh!
There was an error while loading. Please reload this page.
This PR is stale because it has been open for 30 days with no activity. |
This PR is stale because it has been open for 30 days with no activity. |
Any progress here? @serhiy-storchaka I think your review is requested? |
This PR is stale because it has been open for 30 days with no activity. |
ZelphirKaltstahl
commented
Dec 15, 2025
Ping. |
This PR is stale because it has been open for 30 days with no activity. |
ZelphirKaltstahl
commented
Jan 15, 2026
Ping. |
serhiy-storchaka
commented
Jan 19, 2026
Thank you for reminder @ZelphirKaltstahl. I'm going to finish this. Sorry that it took so much time, @mkiever. For now, I have the following comments:
If you have no time, @mkiever, or lost interest, I'll continue this work, preserving your credits. |
There are also mentioning of Both The UPD: |
serhiy-storchaka
commented
Jan 19, 2026
Well, lets keep As for the WidgetViewSync event, this is an error in the documentation. All virtual events have field case'd':
if (flags& (CROSSING|FOCUS)) {
intdetail= (flags&FOCUS) ? evPtr->xfocus.detail : evPtr->xcrossing.detail;
string=TkFindStateString(notifyDetail, detail);
} elseif (flags&CONFIGREQ) {
if (evPtr->xconfigurerequest.value_mask&CWStackMode) {
string=TkFindStateString(configureRequestDetail, evPtr->xconfigurerequest.detail);
} else {
string="";
}
} elseif (flags&VIRTUAL) {
XVirtualEvent*vePtr= (XVirtualEvent*) evPtr;
string=vePtr->user_data ? Tcl_GetString(vePtr->user_data) : "";
}
break; |
koutoftimer
commented
Jan 19, 2026
If you are talking about this As for |
serhiy-storchaka
commented
Jan 24, 2026
Yes, this XEvent. It is a union of different structs that correspond different event types. Each substitution usually corresponds to fields with the same name in different structures. Except "%d", which correspond to |
This PR is stale because it has been open for 30 days with no activity. |
Uh oh!
There was an error while loading. Please reload this page.
…tkinter (pythonGH-7142) Expose the %d substitution as the tkinter.Event attributes: * "detail" for Enter, Leave, FocusIn, FocusOut, and ConfigureRequest events * "user_data" for virtual events Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…tkinter (pythonGH-7142) Expose the %d substitution as the tkinter.Event attributes: * "detail" for Enter, Leave, FocusIn, FocusOut, and ConfigureRequest events * "user_data" for virtual events Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This adds Tk %d event field as 'detail' and 'user_data' attributes to tkinter events.
I have not yet changed the documentation, because I am not sure about the intent
of the table in "25.1.6.7. Bindings and Events" in tkinter documentation.
If supposed to be complete, I suggest also adding the other three missing fields (%#, %b, %D).
I have added a simple test of virtual events and the userdata attribute including bind/unbind.
To make the test possible I use a pump_events function found on
stackoverflow (https://stackoverflow.com/questions/4083796/how-do-i-run-unittest-on-a-tkinter-app/49028688#49028688).
Note, I tested this only on Debian Linux.
Also, I had spurious "Bad Drawable" errors from the X server running the tkinter unittest,
but I have those in the same way on the changed and unchanged Python.
Seems to be my non-mainstream setup (ctwm with interactive window placement).
This is my first pull request. Sorry, if I have forgotten obvious things.
https://bugs.python.org/issue3405