Skip to content
/ python-tk-mvp Public template

MVP pattern in Python Tkinter

License

Notifications You must be signed in to change notification settings

ziteh/python-tk-mvp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Tkinter MVP

An example of MVP (Model-View-Presenter) pattern implementation with Python Tkinter.

Usage

python main.py

UML Class Diagram

---
title: Tk MVP
---
classDiagram
    direction TB

    class PresenterInterface {
        <<interface>>
        on_click()
        on_select(float)
    }
    class Presenter {
        model: Model
        view: ViewInterface
        Presenter(Model, ViewInterface)
        on_click()
        on_select(float)
    }

    class ViewInterface {
        <<interface>>
        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
Loading

About

MVP pattern in Python Tkinter

Topics

Resources

License

Stars

Watchers

Forks

Languages