Message89262
Sometime around Python 2.5.4, Menu.delete was changed to delete
associated entry commands (and thus plug a memory leak). This broke
Pmw.OptionMenu because it already had similar code, so when Menu.delete
was called, the commands were already gone, and a TclError was raised
saying "can't delete Tcl command".
While Pmw could be patched to workaround this bug, it seems strange that
Tkinter.Misc.deletecommand unconditionally deletes commands it knows
nothing about. All uses of deletecommand in Tkinter refer to commands
that were Tkinter.Misc._register'ed, so they should appear in the
widget._tclCommands list. So the proper solution is to only delete
commands that are still registered with the widget.
Repeat by:
import Pmw
om = Pmw.OptionMenu()
om.pack()
om.setitems(['a', 'b'])
om.setitems(['b']) |
|
Date |
User |
Action |
Args |
2009-06-11 21:09:40 | gregcouch | set | recipients:
+ gregcouch |
2009-06-11 21:09:40 | gregcouch | set | messageid: <1244754580.13.0.801057820447.issue6270@psf.upfronthosting.co.za> |
2009-06-11 21:09:39 | gregcouch | link | issue6270 messages |
2009-06-11 21:09:38 | gregcouch | create | |
|