MCPcopy Index your code
hub / github.com/RustPython/RustPython / __init__

Method __init__

Lib/tkinter/ttk.py:1588–1614  ·  view source on GitHub ↗

Construct a themed OptionMenu widget with master as the parent, the resource textvariable set to variable, the initially selected value specified by the default parameter, the menu values given by *values and additional keywords. WIDGET-SPECIFIC OPTIONS

(self, master, variable, default=None, *values, **kwargs)

Source from the content-addressed store, hash-verified

1586 the user to select a value from a menu."""
1587
1588 def __init__(self, master, variable, default=None, *values, **kwargs):
1589 """Construct a themed OptionMenu widget with master as the parent,
1590 the resource textvariable set to variable, the initially selected
1591 value specified by the default parameter, the menu values given by
1592 *values and additional keywords.
1593
1594 WIDGET-SPECIFIC OPTIONS
1595
1596 style: stylename
1597 Menubutton style.
1598 direction: 'above', 'below', 'left', 'right', or 'flush'
1599 Menubutton direction.
1600 command: callback
1601 A callback that will be invoked after selecting an item.
1602 """
1603 kw = {'textvariable': variable, 'style': kwargs.pop('style', None),
1604 'direction': kwargs.pop('direction', None)}
1605 Menubutton.__init__(self, master, **kw)
1606 self['menu'] = tkinter.Menu(self, tearoff=False)
1607
1608 self._variable = variable
1609 self._callback = kwargs.pop('command', None)
1610 if kwargs:
1611 raise tkinter.TclError('unknown option -%s' % (
1612 next(iter(kwargs.keys()))))
1613
1614 self.set_menu(default, *values)
1615
1616
1617 def __getitem__(self, item):

Callers

nothing calls this directly

Calls 6

set_menuMethod · 0.95
nextFunction · 0.85
iterFunction · 0.85
popMethod · 0.45
__init__Method · 0.45
keysMethod · 0.45

Tested by

no test coverage detected