Web Analytics Made Easy - Statcounter
Skip to content

OptionMenu

The Option Menu looks much like a ComboBox. Instead of an arrow to click to pull down the list of choices, another little graphic is shown on the widget to indicate where you click. After clicking to activate, it looks like a Combo Box that you scroll to select a choice.

OptionMenu(
    values,
    default_value = None,
    size = (None, None),
    disabled = False,
    auto_size_text = None,
    background_color = None,
    text_color = None,
    key = None,
    pad = None,
    tooltip = None
)

Parameter Descriptions

Name Type Default Description
auto_size_text bool None True if size of Element should match the contents of the items
background_color str None color of background
default_value Any None the value to choose by default
disabled bool False control enabled / disabled
key str or int or tuple or object None Used with window.find_element and with return values to uniquely identify this element
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
size (int, int) (width, UNUSED) (None, None) (width, height) size in characters (wide), height is ignored and present to be consistent with other elements
text_color str None color of the text
tooltip str None text that will appear when mouse hovers over this element
values List[Any] or Tuple[Any] Values to be displayed

Class Properties

This class has no public properties

Class Methods

 def update

update

Changes some of the settings for the OptionMenu Element. Must call Window.Read or Window.Finalize prior

Changes will not be visible in your window until you call window.read or window.refresh.

update(
    value = None,
    values = None,
    disabled = None
)

Parameter Descriptions

Name Type Default Description
disabled bool None disable or enable state of the element
value Any None the value to choose by default
values List[Any] None Values to be displayed