wx.RadioBox

Inheritance diagram for wx.RadioBox:



Description

A radio box item is used to select one of number of mutually exclusive choices. It is displayed as a vertical column or horizontal row of labelled buttons.

Window Styles

Window Style Description
wx.RA_SPECIFY_ROWS The major dimension parameter refers to the maximum number of rows.
wx.RA_SPECIFY_COLS The major dimension parameter refers to the maximum number of columns.
wx.RA_USE_CHECKBOX Use of the checkbox controls instead of radio buttons (currently supported only on PalmOS)

Event Handling

Event Name Description
wx.EVT_RADIOBOX(id, func) Process a wx.wxEVT_COMMAND_RADIOBOX_SELECTED event, when a radiobutton is clicked.

Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


Properties Summary

Class API

Methods

__init__(parent, id=-1, label="", pos=wx.DefaultPosition, size=wx.DefaultSize, choices=[], majorDimension=0, style=wx.RA_SPECIFY_COLS, validator=wx.DefaultValidator, name=wx.RadioBoxNameStr)

Constructor.

Parameters:


Returns:

wx.RadioBox


Enable(enable=True)

Enables or disables the entire radiobox.

Parameters:

  • enable (bool): True to enable, False to disable

See also

wx.Window.Enable


EnableItem(n, enable=True)

Enables or disables an individual button in the radiobox.

Parameters:

  • n (int): The zero-based button to enable or disable.
  • enable (bool): True to enable, False to disable.

FindString(string)

Finds a button matching the given string, returning the position if found, or -1 if not found.

Parameters:

  • string (string): The string to find.

GetColumnCount()

Returns the number of columns in the radiobox.


Returns:

int


GetItemHelpText(item)

Returns the helptext associated with the specified item if any or "".

Parameters:

  • item (int): The zero-based item index.

Returns:

string

See also

SetItemHelpText


GetItemLabel(item)

Enables or disables an individual button in the radiobox.

Parameters:

  • item (int): Returns the label for the given button

Returns:

string


GetItemToolTip(item)

Returns the tooltip associated with the specified item if any or None.

Parameters:

  • item (int): The zero-based item index.

Returns:

wx.ToolTip


GetLabel()

Returns the radiobox label.


Returns:

string


GetNextItem(item, dir, style)

Parameters:

  • item (int)
  • dir (int)
  • style (long)

Returns:

int


GetRowCount()

Returns the number of rows in the radiobox.


Returns:

unsigned int


GetSelection()

Returns the zero-based position of the selected button.


Returns:

int


GetStringSelection()

Returns the selected string.


Returns:

string


GetString(n)

Returns the label for the button at the given position.

Parameters:

  • n (int): The zero-based button position.

Returns:

string


IsItemEnabled(n)

Returns True if the item is enabled or False if it was disabled using EnableItem.

Parameters:

  • n (int): The zero-based button position.

Returns:

bool

Note

Platform note: Currently only implemented in wxMSW, wxGTK and wxUniversal and always returns True in the other ports.


IsItemShown(n)

Returns True if the item is currently shown or False if it was hidden using ShowItem.

Parameters:

  • n (int): The zero-based button position.

Returns:

bool

Note

Note that this function returns True for an item which hadn’t been hidden even if the entire radiobox is not currently shown.

Note

Platform note: Currently only implemented in wxMSW, wxGTK and wxUniversal and always returns True in the other ports.


SetItemHelpText(item, helptext)

Sets the helptext for an item. Empty string erases any existing helptext.

Parameters:

  • item (int): The zero-based item index.
  • helptext (string): The help text to set for the item.

See also

GetItemHelpText


SetItemLabel(n, string):

Sets the radiobox label.

Parameters:

  • n (int): The zero-based button position.
  • string (string): The radiobutton label.

SetItemToolTip(item, tooltip)

Sets the tooltip text for the specified item in the radio group.

Parameters:

  • item (int): The zero-based item index.
  • tooltip (string): The item tooltip.

Note

Platform note: Currently only implemented in wxMSW and wxGTK2 and does nothing in the other ports.


SetLabel(string):

Sets the radiobox label.

Parameters:

  • string (string): The radiobox label.

SetSelection(n)

Sets a button by passing the desired string position. This does not cause a wx.wxEVT_COMMAND_RADIOBOX_SELECTED event to get emitted.

Parameters:

  • n (int): The zero-based button position.

SetStringSelection(string)

Sets a button by passing the desired string. This does not cause a wx.wxEVT_COMMAND_RADIOBOX_SELECTED event to get emitted.

Parameters:

  • string (string): The label of the button to select.

Show(show=True)

Shows or hides the radiobox.

Returns True if the box or item has been shown or hidden or False if nothing was done because it already was in the requested state.

Parameters:

  • show (bool): True to show, False to hide.

Returns:

bool

See also

wx.Window.Show


ShowItem(item, show=True)

Shows or hides individual buttons.

Returns True if the box or item has been shown or hidden or False if nothing was done because it already was in the requested state

Parameters:

  • item (int): The zero-based position of the button to show or hide.
  • show (bool): True to show, False to hide.

Returns:

bool


Properties

ColumnCount
See GetColumnCount
RowCount
See GetRowCount