https://github.com/ziteh/python-tk-mvp
MVP pattern in Python Tkinter
https://github.com/ziteh/python-tk-mvp
gui mvp python tkinter
Last synced: about 2 months ago
JSON representation
MVP pattern in Python Tkinter
- Host: GitHub
- URL: https://github.com/ziteh/python-tk-mvp
- Owner: ziteh
- License: unlicense
- Created: 2024-05-03T13:53:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-17T13:01:28.000Z (over 1 year ago)
- Last Synced: 2025-03-05T21:01:52.153Z (11 months ago)
- Topics: gui, mvp, python, tkinter
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Tkinter MVP
An example of MVP (Model-View-Presenter) pattern implementation with Python [Tkinter](https://docs.python.org/3/library/tkinter.html).
## Usage
```bash
python main.py
```
## UML Class Diagram
```mermaid
---
title: Tk MVP
---
classDiagram
direction TB
class PresenterInterface {
<>
on_click()
on_select(float)
}
class Presenter {
model: Model
view: ViewInterface
Presenter(Model, ViewInterface)
on_click()
on_select(float)
}
class ViewInterface {
<>
setup(PresenterInterface)
set_value(float)
get_value() float
}
class View {
root: tk.Tk
presenter: PresenterInterface
View(tk.Tk)
setup(PresenterInterface)
set_value(float)
get_value() float
}
class Model {
data: float
set_data(float)
get_data() float
}
PresenterInterface <.. View : Use
ViewInterface <|.. View : Implementation
ViewInterface <.. Presenter : Use
PresenterInterface <.. ViewInterface : Use
PresenterInterface <|.. Presenter : Implementation
Model --o Presenter : Aggregation
```