MCPcopy Index your code
hub / github.com/python/cpython / Combobox

Class Combobox

Lib/tkinter/ttk.py:668–702  ·  view source on GitHub ↗

Ttk Combobox widget combines a text field with a pop-down list of values.

Source from the content-addressed store, hash-verified

666
667
668class Combobox(Entry):
669 """Ttk Combobox widget combines a text field with a pop-down list of
670 values."""
671
672 def __init__(self, master=None, **kw):
673 """Construct a Ttk Combobox widget with the parent master.
674
675 STANDARD OPTIONS
676
677 class, cursor, style, takefocus
678
679 WIDGET-SPECIFIC OPTIONS
680
681 exportselection, justify, height, postcommand, state,
682 textvariable, values, width
683 """
684 Entry.__init__(self, master, "ttk::combobox", **kw)
685
686
687 def current(self, newindex=None):
688 """If newindex is supplied, sets the combobox value to the
689 element at position newindex in the list of values. Otherwise,
690 returns the index of the current value in the list of values
691 or -1 if the current value does not appear in the list."""
692 if newindex is None:
693 res = self.tk.call(self._w, "current")
694 if res == '':
695 return -1
696 return self.tk.getint(res)
697 return self.tk.call(self._w, "current", newindex)
698
699
700 def set(self, value):
701 """Sets the value of the combobox to value."""
702 self.tk.call(self._w, "set", value)
703
704
705class Frame(Widget):

Callers 1

create_page_windowsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…