diff options
author | Steven M. Gava <elguavas@python.net> | 2001-11-03 14:55:47 (GMT) |
---|---|---|
committer | Steven M. Gava <elguavas@python.net> | 2001-11-03 14:55:47 (GMT) |
commit | c034b47ef39cf757d241888e93df11876ee53f48 (patch) | |
tree | 87e6e31fbade2a41e012a3eb40bf174219e3fdef /Lib/idlelib | |
parent | 9dd16b34438dfbb322737f4f8c5cce32f4821bda (diff) | |
download | cpython-c034b47ef39cf757d241888e93df11876ee53f48.zip cpython-c034b47ef39cf757d241888e93df11876ee53f48.tar.gz cpython-c034b47ef39cf757d241888e93df11876ee53f48.tar.bz2 |
added ability to set hilightthickness
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/dynOptionMenuWidget.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/idlelib/dynOptionMenuWidget.py b/Lib/idlelib/dynOptionMenuWidget.py index 8f64a0a..bc716ed 100644 --- a/Lib/idlelib/dynOptionMenuWidget.py +++ b/Lib/idlelib/dynOptionMenuWidget.py @@ -1,22 +1,28 @@ ##---------------------------------------------------------------------------## ## -## idle - tkinter OptionMenu widget modified to allow dynamic -## reconfiguration of menu. +## idle - modified OptionMenu widget ## elguavas ## ##---------------------------------------------------------------------------## """ OptionMenu widget modified to allow dynamic menu reconfiguration +and setting of highlightthickness """ from Tkinter import OptionMenu from Tkinter import _setit +import copy class DynOptionMenu(OptionMenu): """ - OptionMenu widget that allows dynamic menu reconfiguration + unlike OptionMenu, our kwargs can include highlightthickness """ def __init__(self, master, variable, value, *values, **kwargs): + #get a copy of kwargs before OptionMenu.__init__ munges them + kwargsCopy=copy.copy(kwargs) + if 'highlightthickness' in kwargs.keys(): + del(kwargs['highlightthickness']) OptionMenu.__init__(self, master, variable, value, *values, **kwargs) + self.config(highlightthickness=kwargsCopy.get('highlightthickness')) #self.menu=self['menu'] self.variable=variable self.command=kwargs.get('command') |