Radio Button Element - Used in a group of other Radio Elements to provide user with ability to select only 1 choice in a list of choices.
| 2989 | # Radio # |
| 2990 | # ---------------------------------------------------------------------- # |
| 2991 | class Radio(Element): |
| 2992 | """ |
| 2993 | Radio Button Element - Used in a group of other Radio Elements to provide user with ability to select only |
| 2994 | 1 choice in a list of choices. |
| 2995 | """ |
| 2996 | |
| 2997 | def __init__(self, text, group_id, default=False, disabled=False, size=(None, None), s=(None, None), auto_size_text=None, setting=None, |
| 2998 | background_color=None, text_color=None, circle_color=None, font=None, key=None, k=None, pad=None, p=None, tooltip=None, |
| 2999 | change_submits=False, enable_events=False, right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None): |
| 3000 | """ |
| 3001 | :param text: Text to display next to button |
| 3002 | :type text: (str) |
| 3003 | :param group_id: Groups together multiple Radio Buttons. Any type works |
| 3004 | :type group_id: (Any) |
| 3005 | :param default: Set to True for the one element of the group you want initially selected |
| 3006 | :type default: (bool) |
| 3007 | :param disabled: set disable state |
| 3008 | :type disabled: (bool) |
| 3009 | :param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1 |
| 3010 | :type size: (int, int) | (None, None) | int |
| 3011 | :param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used |
| 3012 | :type s: (int, int) | (None, None) | int |
| 3013 | :param auto_size_text: if True will size the element to match the length of the text |
| 3014 | :type auto_size_text: (bool) |
| 3015 | :param setting: If not None, then this element will be saved in a settings file using the key for the element |
| 3016 | :type setting: (Any) |
| 3017 | :param background_color: color of background |
| 3018 | :type background_color: (str) |
| 3019 | :param text_color: color of the text |
| 3020 | :type text_color: (str) |
| 3021 | :param circle_color: color of background of the circle that has the dot selection indicator in it |
| 3022 | :type circle_color: (str) |
| 3023 | :param font: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
| 3024 | :type font: (str or (str, int[, str]) or None) |
| 3025 | :param key: Used with window.find_element and with return values to uniquely identify this element |
| 3026 | :type key: str | int | tuple | object |
| 3027 | :param k: Same as the Key. You can use either k or key. Which ever is set will be used. |
| 3028 | :type k: str | int | tuple | object |
| 3029 | :param pad: 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) |
| 3030 | :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) | int |
| 3031 | :param p: Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used |
| 3032 | :type p: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) | int |
| 3033 | :param tooltip: text, that will appear when mouse hovers over the element |
| 3034 | :type tooltip: (str) |
| 3035 | :param change_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead |
| 3036 | :type change_submits: (bool) |
| 3037 | :param enable_events: Turns on the element specific events. Radio Button events happen when an item is selected |
| 3038 | :type enable_events: (bool) |
| 3039 | :param right_click_menu: A list of lists of Menu items to show when this element is right clicked. See user docs for exact format. |
| 3040 | :type right_click_menu: List[List[ List[str] | str ]] |
| 3041 | :param expand_x: If True the element will automatically expand in the X direction to fill available space |
| 3042 | :type expand_x: (bool) |
| 3043 | :param expand_y: If True the element will automatically expand in the Y direction to fill available space |
| 3044 | :type expand_y: (bool) |
| 3045 | :param visible: set visibility state of the element |
| 3046 | :type visible: (bool) |
| 3047 | :param metadata: User metadata that can be set to ANYTHING |
| 3048 | :type metadata: (Any) |
no outgoing calls
no test coverage detected