Create Tkinter GUIs from JSON definition files

The idea behind this simple module is that you can define Tkinter GUIs in a JSON file format. All value which can be configured for an widget can be defined in those files. The module ‘tkgen’ has an Generator class which is able to parse these files and return you a Tk root.

To use a JSON file as input:

root = tkgen.gengui.TkJson('ui.json', title = 'Some test gui...')
root.mainloop()

Please see the examples in the ‘examples/’ directory for more details on how to use this package.

Module can be retrieved from pypi as well:

easy_install/pip install pytkgen

Some useful Tips

So since the GUI itself is defined in a JSON file you need to lookup the widgets in your python code to do actual operations on them. The gengui module offers some routines which will make your life easy:

Supported Attributes for Grid placement

On top of all attributes supported by a widget, the following attributes can be used in the JSON files to refine the placement of widgets in the Grid Geometry Manager:

Changelog

1.5

1.4

1.3

1.2

1.1

Feel free to play around with this - I do not guarantee that it is perfect nor complete - Have Fun!

(c) 2011-2016 tmetsch