wx.Choice

Inheritance diagram for wx.Choice:



Description

A choice item is used to select one of a list of strings. Unlike a listbox, only the selection is visible until the user pulls down the menu of choices.

Event Handling

Event Name Description
wx.EVT_CHOICE(id, func) Process a wx.wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the list is selected.

Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


Properties Summary

Class API

Methods

__init__(parent, id, pos=wx.DefaultPosition, size=wx.DefaultSize, choices=[], style=0, validator=wx.DefaultValidator, name=wx.ChoiceNameStr)

Create and show a wx.Choice control.

Parameters:


Returns:

wx.Choice


GetCurrentSelection()

Unlike GetSelection which only returns the accepted selection value, i.e. the selection in the control once the user closes the dropdown list, this function returns the current selection. That is, while the dropdown list is shown, it returns the currently selected item in it. When it is not shown, its result is the same as for the other function.

This function is new since wxWidgets version 2.6.2 (before this version GetSelection itself behaved like this).


Returns:

int


Properties

CurrentSelection
See GetCurrentSelection