GUIBRUSHR.GUI.WIDGET.MyLabel module

class GUIBRUSHR.GUI.WIDGET.MyLabel.MyLabel(parent: Any, row: int, column: int, color: str = '#AAAAAA', label_text: str = 'Label', font: Tuple[str, int, str] | None = None, columnspan: int = 1, **kwargs: Dict[str, Any])[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.

label

The underlying tkinter Label widget

Type:

Label

__init__(parent: Any, row: int, column: int, color: str = '#AAAAAA', label_text: str = 'Label', font: Tuple[str, int, str] | None = None, columnspan: int = 1, **kwargs: Dict[str, Any]) None[source]

Initialize the MyLabel widget.

Parameters:
  • parent – The parent widget

  • row – Row position in the parent’s grid

  • column – Column position in the parent’s grid

  • color – Background color of the label

  • label_text – Text to display in the label

  • font – Font specification (family, size, style)

  • columnspan – Number of columns the label should span

  • **kwargs – Additional keyword arguments passed to the Label widget

set_text(text: str) None[source]

Set the text of the label.

Parameters:

text – The new text to display

get_text() str[source]

Get the current text of the label.

Returns:

The current text displayed in the label

Return type:

str