开发者

How to implement the MVC-pattern in Tkinter

开发者 https://www.devze.com 2023-04-10 01:28 出处:网络
I need a basic example where MVC p开发者_开发知识库attern is used with Python TK. I have some code using Tkinter, however I would like to transform it using the MVC pattern.I know this is quite old bu

I need a basic example where MVC p开发者_开发知识库attern is used with Python TK. I have some code using Tkinter, however I would like to transform it using the MVC pattern.


I know this is quite old but I was able to find some decent examples using the MVC pattern with both Tk and wxPython, hopefully they provide some help for anyone stumbling upon this question.

wxPython: http://wiki.wxpython.org/ModelViewController

Tk: http://tkinter.unpythonic.net/wiki/ToyMVC This website no longer exists so I've hosted the code on a Gist here.


Here's an interesting example: https://sukhbinder.wordpress.com/2014/12/25/an-example-of-model-view-controller-design-pattern-with-tkinter-python/

I would also recommend this book where the author goes through how to structure your Tkinter application in a model-view way: https://www.packtpub.com/application-development/tkinter-gui-application-development-hotshot

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号