# lawsie/guizero architecture

> Architecture diagram of the GitHub repository lawsie/guizero, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lawsie/guizero
- Repository: https://github.com/lawsie/guizero

## Overview

guizero is a beginner-friendly Python GUI library built on Tkinter. A developer creates an App, adds widgets and containers, then calls display() to enter the GUI event loop; widget events can invoke application callbacks. The graph includes the documented widget families, dialogs, drawing and image support, and the shared layout/event abstractions. Source-index references and excerpts support the shown internal links; some widget implementations were not sampled, so their connections are limited to those references.

Main entry points: [`guizero/base.py`](https://github.com/lawsie/guizero/blob/master/guizero/base.py) (Base and layout), [`guizero/utilities.py`](https://github.com/lawsie/guizero/blob/master/guizero/utilities.py) (Utilities and images), [`guizero/event.py`](https://github.com/lawsie/guizero/blob/master/guizero/event.py) (Event manager), [`guizero/ButtonGroup.py`](https://github.com/lawsie/guizero/blob/master/guizero/ButtonGroup.py) (ButtonGroup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application windows"]
  node_app["App<br/>[App.py]"]
  node_window["Window<br/>[Window.py]"]
end

subgraph group_widgets["Widgets and controls"]
  node_box["Box<br/>[Box.py]"]
  node_button["PushButton<br/>[PushButton.py]"]
  node_button_group["ButtonGroup<br/>[ButtonGroup.py]"]
  node_radio["RadioButton<br/>[RadioButton.py]"]
  node_checkbox["CheckBox<br/>[CheckBox.py]"]
  node_combo["Combo<br/>[Combo.py]"]
  node_listbox["ListBox<br/>[ListBox.py]"]
  node_text_controls["Text controls<br/>[TextBox.py]"]
  node_text["Text<br/>[Text.py]"]
  node_slider["Slider<br/>[Slider.py]"]
end

subgraph group_runtime["Shared runtime"]
  node_base["Base and layout<br/>[base.py]"]
  node_mixins["Tk mixins<br/>[tkmixins.py]"]
  node_events["Event manager<br/>[event.py]"]
  node_utilities["Utilities and images<br/>[utilities.py]"]
end

subgraph group_media["Dialogs and media"]
  node_drawing["Drawing<br/>[Drawing.py]"]
  node_waffle["Waffle<br/>[Waffle.py]"]
  node_picture["Picture<br/>[Picture.py]"]
  node_dialogs["Dialogs<br/>[dialog.py]"]
end

node_developer(("Python developer"))
node_tkinter["Tkinter"]

node_developer -->|"creates app"| node_app
node_app -->|"initializes window"| node_base
node_app -->|"starts main loop"| node_tkinter
node_window -->|"uses window base"| node_base
node_box -->|"uses layout base"| node_base
node_button -->|"uses widget base"| node_base
node_button_group -->|"creates options"| node_radio
node_button_group -->|"uses container base"| node_base
node_radio -->|"uses widget base"| node_base
node_checkbox -->|"uses widget base"| node_base
node_combo -->|"uses widget base"| node_base
node_listbox -->|"uses widget base"| node_base
node_text_controls -->|"uses widget base"| node_base
node_text -->|"uses widget base"| node_base
node_slider -->|"uses widget base"| node_base
node_drawing -->|"uses widget base"| node_base
node_waffle -->|"uses widget base"| node_base
node_picture -->|"uses widget base"| node_base
node_base -->|"inherits behaviors"| node_mixins
node_mixins -->|"uses utilities"| node_utilities
node_button_group -->|"registers events"| node_events
node_listbox -->|"registers selection"| node_events
node_drawing -->|"registers events"| node_events
node_waffle -->|"registers events"| node_events
node_base -->|"uses utilities"| node_utilities
node_drawing -->|"loads images"| node_utilities
node_utilities -->|"creates Tk images"| node_tkinter
node_dialogs -->|"opens native dialogs"| node_tkinter

click node_app "https://github.com/lawsie/guizero/blob/master/guizero/App.py"
click node_window "https://github.com/lawsie/guizero/blob/master/guizero/Window.py"
click node_box "https://github.com/lawsie/guizero/blob/master/guizero/Box.py"
click node_button "https://github.com/lawsie/guizero/blob/master/guizero/PushButton.py"
click node_button_group "https://github.com/lawsie/guizero/blob/master/guizero/ButtonGroup.py"
click node_radio "https://github.com/lawsie/guizero/blob/master/guizero/RadioButton.py"
click node_checkbox "https://github.com/lawsie/guizero/blob/master/guizero/CheckBox.py"
click node_combo "https://github.com/lawsie/guizero/blob/master/guizero/Combo.py"
click node_listbox "https://github.com/lawsie/guizero/blob/master/guizero/ListBox.py"
click node_text_controls "https://github.com/lawsie/guizero/blob/master/guizero/TextBox.py"
click node_text "https://github.com/lawsie/guizero/blob/master/guizero/Text.py"
click node_slider "https://github.com/lawsie/guizero/blob/master/guizero/Slider.py"
click node_drawing "https://github.com/lawsie/guizero/blob/master/guizero/Drawing.py"
click node_waffle "https://github.com/lawsie/guizero/blob/master/guizero/Waffle.py"
click node_picture "https://github.com/lawsie/guizero/blob/master/guizero/Picture.py"
click node_base "https://github.com/lawsie/guizero/blob/master/guizero/base.py"
click node_mixins "https://github.com/lawsie/guizero/blob/master/guizero/tkmixins.py"
click node_events "https://github.com/lawsie/guizero/blob/master/guizero/event.py"
click node_utilities "https://github.com/lawsie/guizero/blob/master/guizero/utilities.py"
click node_dialogs "https://github.com/lawsie/guizero/blob/master/guizero/dialog.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_window toneBlue
class node_box,node_button,node_button_group,node_radio,node_checkbox,node_combo,node_listbox,node_text_controls,node_text,node_slider toneAmber
class node_base,node_mixins,node_events,node_utilities toneMint
class node_drawing,node_waffle,node_picture,node_dialogs toneRose
class node_developer,node_tkinter toneIndigo
```

## Components

### Application windows

- [App](https://github.com/lawsie/guizero/blob/master/guizero/App.py): `guizero/App.py`
- [Window](https://github.com/lawsie/guizero/blob/master/guizero/Window.py): `guizero/Window.py`

### Widgets and controls

- [Box](https://github.com/lawsie/guizero/blob/master/guizero/Box.py): `guizero/Box.py`
- [PushButton](https://github.com/lawsie/guizero/blob/master/guizero/PushButton.py): `guizero/PushButton.py`
- [ButtonGroup](https://github.com/lawsie/guizero/blob/master/guizero/ButtonGroup.py): `guizero/ButtonGroup.py`
- [RadioButton](https://github.com/lawsie/guizero/blob/master/guizero/RadioButton.py): `guizero/RadioButton.py`
- [CheckBox](https://github.com/lawsie/guizero/blob/master/guizero/CheckBox.py): `guizero/CheckBox.py`
- [Combo](https://github.com/lawsie/guizero/blob/master/guizero/Combo.py): `guizero/Combo.py`
- [ListBox](https://github.com/lawsie/guizero/blob/master/guizero/ListBox.py): `guizero/ListBox.py`
- [Text controls](https://github.com/lawsie/guizero/blob/master/guizero/TextBox.py): `guizero/TextBox.py`
- [Text](https://github.com/lawsie/guizero/blob/master/guizero/Text.py): `guizero/Text.py`
- [Slider](https://github.com/lawsie/guizero/blob/master/guizero/Slider.py): `guizero/Slider.py`

### Shared runtime

- [Base and layout](https://github.com/lawsie/guizero/blob/master/guizero/base.py): `guizero/base.py`
- [Tk mixins](https://github.com/lawsie/guizero/blob/master/guizero/tkmixins.py): `guizero/tkmixins.py`
- [Event manager](https://github.com/lawsie/guizero/blob/master/guizero/event.py): `guizero/event.py`
- [Utilities and images](https://github.com/lawsie/guizero/blob/master/guizero/utilities.py): `guizero/utilities.py`

### Dialogs and media

- [Drawing](https://github.com/lawsie/guizero/blob/master/guizero/Drawing.py): `guizero/Drawing.py`
- [Waffle](https://github.com/lawsie/guizero/blob/master/guizero/Waffle.py): `guizero/Waffle.py`
- [Picture](https://github.com/lawsie/guizero/blob/master/guizero/Picture.py): `guizero/Picture.py`
- [Dialogs](https://github.com/lawsie/guizero/blob/master/guizero/dialog.py): `guizero/dialog.py`

### Other components

- **Python developer**
- **Tkinter**

## Connections

- Python developer → App: creates app (evidence: `README.md`)
- App → Base and layout: initializes window (evidence: `guizero/App.py`)
- App → Tkinter: starts main loop (evidence: `guizero/App.py`)
- Window → Base and layout: uses window base (evidence: `guizero/Window.py`)
- Box → Base and layout: uses layout base (evidence: `guizero/Box.py`)
- PushButton → Base and layout: uses widget base (evidence: `guizero/PushButton.py`)
- ButtonGroup → RadioButton: creates options (evidence: `guizero/ButtonGroup.py`)
- ButtonGroup → Base and layout: uses container base (evidence: `guizero/ButtonGroup.py`)
- RadioButton → Base and layout: uses widget base (evidence: `guizero/RadioButton.py`)
- CheckBox → Base and layout: uses widget base (evidence: `guizero/CheckBox.py`)
- Combo → Base and layout: uses widget base (evidence: `guizero/Combo.py`)
- ListBox → Base and layout: uses widget base (evidence: `guizero/ListBox.py`)
- Text controls → Base and layout: uses widget base (evidence: `guizero/TextBox.py`)
- Text → Base and layout: uses widget base (evidence: `guizero/Text.py`)
- Slider → Base and layout: uses widget base (evidence: `guizero/Slider.py`)
- Drawing → Base and layout: uses widget base (evidence: `guizero/Drawing.py`)
- Waffle → Base and layout: uses widget base (evidence: `guizero/Waffle.py`)
- Picture → Base and layout: uses widget base (evidence: `guizero/Picture.py`)
- Base and layout → Tk mixins: inherits behaviors (evidence: `guizero/base.py`)
- Tk mixins → Utilities and images: uses utilities (evidence: `guizero/tkmixins.py`)
- ButtonGroup → Event manager: registers events (evidence: `guizero/ButtonGroup.py`)
- ListBox → Event manager: registers selection (evidence: `guizero/ListBox.py`)
- Drawing → Event manager: registers events (evidence: `guizero/Drawing.py`)
- Waffle → Event manager: registers events (evidence: `guizero/Waffle.py`)
- Base and layout → Utilities and images: uses utilities (evidence: `guizero/base.py`)
- Drawing → Utilities and images: loads images (evidence: `guizero/Drawing.py`)
- Utilities and images → Tkinter: creates Tk images (evidence: `guizero/utilities.py`)
- Dialogs → Tkinter: opens native dialogs (evidence: `guizero/dialog.py`)
