GUIBRUSHR.GUI.WIDGET.MyCheckBox module¶
- class GUIBRUSHR.GUI.WIDGET.MyCheckBox.MyCheckBox(parent: Any, row: int, column: int, text: str = '', initial_value: int = 0, **kwargs)[source]¶
Bases:
FrameA custom checkbox widget that wraps tkinter’s Checkbutton in a Frame.
This class creates a checkbox with customizable appearance and behavior, inheriting from Frame to provide better grid layout management and consistent styling.
- var¶
The variable that stores the checkbox state (0 or 1)
- Type:
IntVar
- checkbox¶
The underlying tkinter Checkbutton widget
- Type:
Checkbutton
- __init__(parent: Any, row: int, column: int, text: str = '', initial_value: int = 0, **kwargs) None[source]¶
Initialize the MyCheckBox widget.
- Parameters:
parent – The parent widget
row – Row position in the parent’s grid
column – Column position in the parent’s grid
text – Text to display next to the checkbox
initial_value – Initial state of the checkbox (0 for unchecked, 1 for checked)
**kwargs – Additional keyword arguments passed to the Checkbutton widget
- get_value() int[source]¶
Get the current value of the checkbox.
- Returns:
0 for unchecked, 1 for checked
- Return type:
int