spino.gui_toolkit.widget.MyCheckBox module

class spino.gui_toolkit.widget.MyCheckBox.MyCheckBox(parent, row, column, text='', initial_value=0, **kwargs)[source]

Bases: Frame

A 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 widget

  • row (int) – Row position in the parent’s grid

  • column (int) – Column position in the parent’s grid

  • text (str) – Text to display next to the checkbox

  • initial_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:

int

set_value(value)[source]

Set the value of the checkbox.

Parameters:

value (int) – 0 for unchecked, 1 for checked

Return type:

None

set_status(status)[source]

Enable or disable the checkbox.

Parameters:

status – The state to set the checkbox to (‘normal’, ‘disabled’, etc.)

Return type:

None