:param text: Text to display next to checkbox :type text: (str) :param default: Set to True if you want this checkbox initially checked :type default: (bool) :param size: (w, h) w=characte
(self, text, default=False, size=(None, None), s=(None, None), auto_size_text=None, setting=None, font=None, background_color=None, text_color=None, checkbox_color=None, highlight_thickness=1, change_submits=False, enable_events=False, disabled=False, key=None, k=None, pad=None, p=None, tooltip=None, right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None)
| 3207 | """ |
| 3208 | |
| 3209 | def __init__(self, text, default=False, size=(None, None), s=(None, None), auto_size_text=None, setting=None, font=None, background_color=None, text_color=None, checkbox_color=None, highlight_thickness=1, change_submits=False, enable_events=False, disabled=False, key=None, k=None, pad=None, p=None, tooltip=None, right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None): |
| 3210 | """ |
| 3211 | :param text: Text to display next to checkbox |
| 3212 | :type text: (str) |
| 3213 | :param default: Set to True if you want this checkbox initially checked |
| 3214 | :type default: (bool) |
| 3215 | :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 |
| 3216 | :type size: (int, int) | (None, None) | int |
| 3217 | :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 |
| 3218 | :type s: (int, int) | (None, None) | int |
| 3219 | :param auto_size_text: if True will size the element to match the length of the text |
| 3220 | :type auto_size_text: (bool) |
| 3221 | :param setting: If not None, then this element will be saved in a settings file using the key for the element |
| 3222 | :type setting: (Any) |
| 3223 | :param font: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
| 3224 | :type font: (str or (str, int[, str]) or None) |
| 3225 | :param background_color: color of background |
| 3226 | :type background_color: (str) |
| 3227 | :param text_color: color of the text |
| 3228 | :type text_color: (str) |
| 3229 | :param checkbox_color: color of background of the box that has the check mark in it. The checkmark is the same color as the text |
| 3230 | :type checkbox_color: (str) |
| 3231 | :param highlight_thickness: thickness of border around checkbox when gets focus |
| 3232 | :type highlight_thickness: (int) |
| 3233 | :param change_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead |
| 3234 | :type change_submits: (bool) |
| 3235 | :param enable_events: Turns on the element specific events. Checkbox events happen when an item changes |
| 3236 | :type enable_events: (bool) |
| 3237 | :param disabled: set disable state |
| 3238 | :type disabled: (bool) |
| 3239 | :param key: Used with window.find_element and with return values to uniquely identify this element |
| 3240 | :type key: str | int | tuple | object |
| 3241 | :param k: Same as the Key. You can use either k or key. Which ever is set will be used. |
| 3242 | :type k: str | int | tuple | object |
| 3243 | :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) |
| 3244 | :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) | int |
| 3245 | :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 |
| 3246 | :type p: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) | int |
| 3247 | :param tooltip: text, that will appear when mouse hovers over the element |
| 3248 | :type tooltip: (str) |
| 3249 | :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. |
| 3250 | :type right_click_menu: List[List[ List[str] | str ]] |
| 3251 | :param expand_x: If True the element will automatically expand in the X direction to fill available space |
| 3252 | :type expand_x: (bool) |
| 3253 | :param expand_y: If True the element will automatically expand in the Y direction to fill available space |
| 3254 | :type expand_y: (bool) |
| 3255 | :param visible: set visibility state of the element |
| 3256 | :type visible: (bool) |
| 3257 | :param metadata: User metadata that can be set to ANYTHING |
| 3258 | :type metadata: (Any) |
| 3259 | """ |
| 3260 | |
| 3261 | self.Text = text |
| 3262 | self.InitialState = bool(default) |
| 3263 | self.Value = None |
| 3264 | self.TKCheckbutton = self.Widget = None # type: tk.Checkbutton |
| 3265 | self.Disabled = disabled |
| 3266 | self.TextColor = text_color if text_color else theme_text_color() |
nothing calls this directly
no test coverage detected