spino.gui_toolkit.widget.MyCheckBox module¶
- class spino.gui_toolkit.widget.MyCheckBox.MyCheckBox(parent, row, column, text='', initial_value=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.
- Variables:
var (IntVar) – The variable that stores the checkbox state (0 or 1)
checkbox (Checkbutton) – The underlying tkinter Checkbutton widget
- Parameters:
- __init__(parent, row, column, text='', initial_value=0, **kwargs)[source]¶
Initialize the MyCheckBox widget.
- Parameters:
parent (
Any) – The parent widgetrow (
int) – Row position in the parent’s gridcolumn (
int) – Column position in the parent’s gridtext (
str) – Text to display next to the checkboxinitial_value (
int) – Initial state of the checkbox (0 for unchecked, 1 for checked)**kwargs – Additional keyword arguments passed to the Checkbutton widget
- Return type:
None
- get_value()[source]¶
Get the current value of the checkbox.
- Returns:
0 for unchecked, 1 for checked
- Return type: