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
Tkinter.Menu.delete doesn't delete command of entry #42536
Comments
Tkinter.Menu.delete does not delete the commands For example, after code like this: button = Menubutton(root, text='Window')
menu = Menu(button)
button['menu'] = menu
def command():
print 'command button pressed'
menu.add_command(command=command)
menu.delete(END)
del command the command function will still be referenced and This may not always be a serious problem, but in I have figured out a possible fix that is in the I also changed the comment - for as far as I can Version info Python 2.3.3 (#2, Mar 11 2004, 19:45:43) I think it applies to all versions: I tested with Sverker Nilsson |
The problem does still exist (Python 2.6b2). I attached a patch for Tkinter.py which addresses this problem. It is |
The patch is fine, please apply (also to the 2.5 and 3.0 branches). |
Fixed in r65622. Backported to the release25-maint and merged into the |
Uhm, this patch can cause trouble if not adapted a bit. The index method If code is needed to confirm this, try the following: |
You are right. How about the attached patch, do you see any problems And does anybody know about a test suite for the Tkinter library where |
You could return if in that new if statement. As you noted, the None argument is ignored there, that is because Regarding a test suite.. it would be very nice to get one for Tkinter. |
change this: "You could return if in that new if statement." to: "You could return in that new if statement.", please. |
I was thinking about returning in that new if statement, too, but Also, with the third beta tomorrow, I am not sure if somebody will find |
If this needs approval of someone else, and such thing doesn't happen in |
Well, beta3 was released and the problem remained there. Robert, I believe MvL assigned this to you for a reason.. I'm a bit |
I am sry that you see it that way, I do not. I was given commit access |
I think the new patch looks fine and should be applied. |
Fixed in r65971. Backported to the release25-maint and merged into the |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: