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:
FrameA 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 widgetrow (
int) – Row position in the parent’s gridcolumn (
int) – Column position in the parent’s gridtext (
str) – Text to display on the buttonbg (
str) – Background color of the buttoncommand – Function to call when button is clicked
color_panel (
str) – Background color of the containing framefg (
str) – Text color of the buttonsize_text (
int) – Font size of the button textcolumnspan (
int) – Number of columns the button should spansticky (
str) – Grid sticky parameter for button placement**kwargs (
Dict[str,Any]) – Additional keyword arguments passed to the Button widget
- Return type:
None