diff options
Diffstat (limited to 'Lib/idlelib/dynOptionMenuWidget.py')
| -rw-r--r-- | Lib/idlelib/dynOptionMenuWidget.py | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/idlelib/dynOptionMenuWidget.py b/Lib/idlelib/dynOptionMenuWidget.py index 48a0886..8f64a0a 100644 --- a/Lib/idlelib/dynOptionMenuWidget.py +++ b/Lib/idlelib/dynOptionMenuWidget.py @@ -21,7 +21,7 @@ class DynOptionMenu(OptionMenu):          self.variable=variable          self.command=kwargs.get('command') -    def SetMenu(self,valueList,value): +    def SetMenu(self,valueList,value=None):          """          clear and reload the menu with a new set of options.          valueList - list of new options @@ -31,4 +31,5 @@ class DynOptionMenu(OptionMenu):          for item in valueList:              self['menu'].add_command(label=item,                      command=_setit(self.variable,item,self.command)) -        self.variable.set(value) +        if value: +            self.variable.set(value)  | 
