{"id":13502788,"url":"https://github.com/tmetsch/pytkgen","last_synced_at":"2025-03-29T12:32:49.036Z","repository":{"id":57457861,"uuid":"1640110","full_name":"tmetsch/pytkgen","owner":"tmetsch","description":"Create Tkinter GUIs from JSON definition files.","archived":false,"fork":false,"pushed_at":"2020-06-22T08:08:50.000Z","size":53,"stargazers_count":120,"open_issues_count":2,"forks_count":26,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-09-24T20:07:28.467Z","etag":null,"topics":["gui","json","tk","tkinter"],"latest_commit_sha":null,"homepage":"http://tmetsch.github.io/pytkgen/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmetsch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-04-20T11:47:55.000Z","updated_at":"2023-12-02T18:20:08.000Z","dependencies_parsed_at":"2022-09-07T01:53:38.669Z","dependency_job_id":null,"html_url":"https://github.com/tmetsch/pytkgen","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmetsch%2Fpytkgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmetsch%2Fpytkgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmetsch%2Fpytkgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmetsch%2Fpytkgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmetsch","download_url":"https://codeload.github.com/tmetsch/pytkgen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222495216,"owners_count":16993288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gui","json","tk","tkinter"],"created_at":"2024-07-31T22:02:25.067Z","updated_at":"2024-10-31T22:30:52.646Z","avatar_url":"https://github.com/tmetsch.png","language":"Python","readme":"\nCreate Tkinter GUIs from JSON definition files\n==============================================\n\nThe idea behind this simple module is that you can define Tkinter GUIs in\na JSON file format. All value which can be configured for an widget can\nbe defined in those files. The module 'tkgen' has an Generator class which is\nable to parse these files and return you a Tk root.\n\nTo use a JSON file as input:\n\n    root = tkgen.gengui.TkJson('ui.json', title = 'Some test gui...')\n    root.mainloop()\n\nPlease see the examples in the 'examples/' directory for more details on how to\nuse this package.\n\nModule can be retrieved from [pypi](http://pypi.python.org/pypi/pytkgen/) as \nwell:\n\n    easy_install/pip install pytkgen\n\nSome useful Tips\n----------------\n\nSo since the GUI itself is defined in a JSON file you need to lookup the\nwidgets in your python code to do actual operations on them. The gengui module\noffers some routines which will make your life easy:\n\n  * get(name) - Returns the Tkinter widget object of the widget with the given\n    name. Requires that a name was indeed defined in the definition file for\n    this widget. Now that you have the object for an Tkinter widget you can do\n    everything which is defined for this particular widget with it using known\n    techniques.\n    \n  * button(name, cmd, [...]) - Associates a 'Button' widget with a command - For\n    example: 'root.destroy'.\n    \n  * checkbox(name, [...]) - Returns an 'IntVar' for a 'Checkbox' so you can\n    retrieve the value (0/1) to see if the User checked the box or not.\n    \n  * entry(name, [...]) - Returns a 'StringVar' for a Entry so you can retrieve\n    and set the value of a Entry widget.\n  \n  * label(name) - Returns a 'StringVar' for a Label so you can retrieve and set\n    the value of a Label widget.\n  \n  * create_from_file([...]) - Create a set of widgets from a file and add them\n    to a given parent widget.\n  \n  * notebook([...]) - Adds a tab to a tkk Notebook widget which is itself\n    defined by a JSON file.\n  \n  * treeview([...]) - Adds a item to a given treeview.\n  \n  * toplevel([...]) - Creates a toplevel dialog from a JSON definition file.\n\n  * create_menu([...]) - Create new menus, popup menus or submenus on the fly.\n\n  * xscroll and yscroll([...]) - Adds a Horinzontal/Vertical Scrollbar to a \n    widget.\n\nSupported Attributes for Grid placement\n---------------------------------------\n\nOn top of all attributes supported by a widget, the following attributes can be\nused in the JSON files to refine the placement of widgets in the Grid Geometry\nManager:\n\n  * row, column - Define the row and column in which the widget should appear \n    (default: 0).\n\n  * rowspan, columnspan - Define if the widget should span across multiple rows\n    or columns (default: 1).\n\n  * rowweight, colweight, weight - Define the weight for a row or column or\n    both (weight). If the weight is set the parent rows/columns are configured\n    automatically to take care of the resizing. (default: 0).\n\n  * padx, pady - X,Y padding for the widget (default: 2px).\n\n  * sticky - Defines the sticky attribute as string (default: 'news').\n\nChangelog\n---------\n\n1.5\n\n  * Merged several cool contribs (e.g. ttk/tk preference \u0026 cleanups) from\n    community\n  * enabled it to work with python 2.* and 3.*\n\n1.4\n\n  * Support for sticky attribute in the JSON file\n\n1.3\n\n  * Code optimizations\n  * Support for setting the focus of a widget\n  * More 'supporting routines'\n\n1.2\n\n  * Support for creation of menus\n  * Support for multiple frames in JSON\n  * Support for ttk widgets (Treeview, Notebook, Separator, Progressbar, ...)\n  * Resizing capabilities added (Weights can now be defined in the JSON file; 1 \n    means the widget resize in general, rowweight=1 means it resize horizontal, \n    colweight=1 means it resize vertical; Values \u003e 1 mean that this widget will\n    resize 'faster' (See Tk documentation for more information)).\n\n1.1\n\n  * Initial\n\nFeel free to play around with this - I do not guarantee that it is perfect nor\ncomplete - Have Fun!\n\n(c) 2011-2016 tmetsch\n","funding_links":[],"categories":["Python","GUI Programming"],"sub_categories":["Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmetsch%2Fpytkgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmetsch%2Fpytkgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmetsch%2Fpytkgen/lists"}