spino.gui_toolkit.widget.MyButton module

class spino.gui_toolkit.widget.MyButton.MyButton(parent, row, column, text, bg, command, color_panel='#AAAAAA', fg='black', size_text=12, columnspan=1, sticky='NSEW', **kwargs)[source]

Bases: Frame

A custom button widget that wraps tkinter’s Button in a Frame for better layout control.

This class creates a button with customizable appearance and behavior, inheriting from Frame to provide better grid layout management and consistent styling.

Variables:

button (Button) – The underlying tkinter Button widget

Parameters:
__init__(parent, row, column, text, bg, command, color_panel='#AAAAAA', fg='black', size_text=12, columnspan=1, sticky='NSEW', **kwargs)[source]

Initialize the MyButton 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 on the button

  • bg (str) – Background color of the button

  • command – Function to call when button is clicked

  • color_panel (str) – Background color of the containing frame

  • fg (str) – Text color of the button

  • size_text (int) – Font size of the button text

  • columnspan (int) – Number of columns the button should span

  • sticky (str) – Grid sticky parameter for button placement

  • **kwargs (Dict[str, Any]) – Additional keyword arguments passed to the Button widget

Return type:

None

set_status(status)[source]

Enable or disable the button.

Parameters:

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

Return type:

None