spino.gui_toolkit.widget.MyLabel module

class spino.gui_toolkit.widget.MyLabel.MyLabel(parent, row, column, color='#AAAAAA', label_text='Label', font=None, columnspan=1, **kwargs)[source]

Bases: Frame

A custom label widget that wraps tkinter’s Label in a Frame.

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

Variables:

label (Label) – The underlying tkinter Label widget

Parameters:
__init__(parent, row, column, color='#AAAAAA', label_text='Label', font=None, columnspan=1, **kwargs)[source]

Initialize the MyLabel 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

  • color (str) – Background color of the label

  • label_text (str) – Text to display in the label

  • font (Optional[Tuple[str, int, str]]) – Font specification (family, size, style)

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

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

Return type:

None

set_text(text)[source]

Set the text of the label.

Parameters:

text (str) – The new text to display

Return type:

None

get_text()[source]

Get the current text of the label.

Returns:

The current text displayed in the label

Return type:

str