{ "info": { "author": "asrp", "author_email": "asrp@email.com", "bugtrack_url": null, "classifiers": [], "description": "# uielem - wrapper over Tkinter for more Pythonic UI building\n\nSometimes you just want to make a quick UI to make some visual task easier and\n`Tkinter` is a fast UI toolkit that's packaged with Python since forever. `uielem` hopes to provide a more modern/Pythonic syntax for using `Tkinter`.\n\nA simple example:\n\n## Before\n\n from Tkinter import Tk, Frame, Label, Listbox, Button, mainloop\n\n tkroot = Tk()\n tkroot.title('Kanban')\n frame = Frame(tkroot)\n frame.pack()\n board_frame = Frame(frame)\n board_frame.pack(side='top')\n for board_name in [\"Todo\", \"Doing\", \"Done\"]:\n inner_frame = Frame(board_frame)\n inner_frame.pack(side='left')\n label = Label(inner_frame, text=board_name)\n label.pack(side='top')\n listbox = Listbox(inner_frame)\n listbox.pack(side='top')\n buttons_frame = Frame(frame)\n buttons_frame.pack(side='top')\n add_button = Button(buttons_frame, text='Add item', command=add)\n add_button.pack(side='left')\n remove_button = Button(buttons_frame, text='Remove item', command=remove)\n remove_button.pack(side='left')\n\n mainloop()\n\n## After\n\n from uielem import UI, uidict\n from Tkinter import Tk, Frame, Label, Listbox, Button\n\n uiroot = UI(Tk, name='root', title='Kanban', children=[\n UI(Frame, packside='top', children=[\n UI(Frame, packside='left', name='boards', children=[\n UI(Frame, packside='top', children=[\n UI(Label, text=board_name),\n UI(Listbox, name=board_name.lower())])\n for board_name in [\"Todo\", \"Doing\", \"Done\"]]),\n UI(Frame, packside='left', children=[\n UI(Button, text='Add item', command=add),\n UI(Button, text='Remove item', command=remove), ])])])\n\n uiroot.makeelem()\n uidict[\"root\"].mainloop()\n\n## Installation\n\n pip install -r requirements.txt\n\n`uielem` depends on [undoable](https://github.com/asrp/undoable).\n\n## Usage and features\n\nThe basic pattern is just `UI(, , children=[])`.\n\n### Keyword arguments\n\n- `packside=` sets the packing side for all *children* (contained in the element).\n- `defaulttext=` for a `Tkinter.Entry` set the initial text.\n- `on_*=` sets an event callback (and `_` is replaced by `-`). So passing `on_Button_3=func` is the same as running `elem.bind('', func)` after creation.\n- `set_*=` sets attribute values after creation. For example `set_title=['title']` has the same effect as `title='title'`.\n- Other non-special keyword arguments are passed through to the Tkinter element.\n\n### Other features\n\n- `uidict` contains all named (`name=something`) elements for easy reference. Names must be globally unique (think `id` in SVG).\n- To add and remove child elements from a container, treat it like a list (using `.append`, `.insert` and `.remove`).\n- Children of the wrapper can be accessed by indexing (such as `uiroot[0][1]`).\n- The wrapper can access the Tkinter object with the `.elem` attribute and the Tkinter object can access the wrapper with `.ui`.\n\n## Alternate versions\n\n`uielem` is now rather large so two lighter versions of `uielem` are provided in the `summaries` folder but they may not always be up to date.\n\n- `simple_uielem.py` removes some of the less used features like code generation.\n- `minimal_uielem.py` only works with UIs generated once and never modified after that (like in the example) but is otherwise fully compatible. Also removes the dependency on undoable.\n\nThey also serve as documentation for `uielem`'s architecture/inner workings.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/asrp/uielem", "keywords": "wrapper tkinter pythonic", "license": "", "maintainer": "", "maintainer_email": "", "name": "uielem", "package_url": "https://pypi.org/project/uielem/", "platform": "", "project_url": "https://pypi.org/project/uielem/", "project_urls": { "Homepage": "https://github.com/asrp/uielem" }, "release_url": "https://pypi.org/project/uielem/0.2.2/", "requires_dist": [ "undoable" ], "requires_python": "", "summary": "Wrapper over Tkinter for more Pythonic UI building", "version": "0.2.2" }, "last_serial": 4340570, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "fd8aae3efa75eae205f9dd299c370241", "sha256": "584ab6a4ee9824cff54f51b9e20fa13b3fe86824b587ce995af10a32c2b1f1cb" }, "downloads": -1, "filename": "uielem-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "fd8aae3efa75eae205f9dd299c370241", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 2485, "upload_time": "2018-10-04T14:03:09", "url": "https://files.pythonhosted.org/packages/c8/ab/3ead766c53a4733440aeeb82b00bd7901f7a121899b241b59da4a57abbbb/uielem-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d507dd81a186f6556afc31aaf755a62a", "sha256": "eb1437e702972dfb94ef65173969a89a1fefc18197d6abe647de16a971e754d7" }, "downloads": -1, "filename": "uielem-0.2.tar.gz", "has_sig": false, "md5_digest": "d507dd81a186f6556afc31aaf755a62a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2860, "upload_time": "2018-10-04T14:03:10", "url": "https://files.pythonhosted.org/packages/62/65/e3ac33fa200f7eb5e0314c6f0f7a6e55596748f02eea23ed1e17e8b3434e/uielem-0.2.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "f2384a20795c18acdc61a5111365add2", "sha256": "7c749eff68b10680dd4dc663189ab87c69c5c2b830f937d73d73c16f6f814e70" }, "downloads": -1, "filename": "uielem-0.2.2-py2-none-any.whl", "has_sig": false, "md5_digest": "f2384a20795c18acdc61a5111365add2", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 2516, "upload_time": "2018-10-04T14:32:46", "url": "https://files.pythonhosted.org/packages/ab/4e/a4940a24cd16a53f403402743bba15776a87fc634efba5e096ab88f2c11c/uielem-0.2.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3dc302ea01bb06b39ec273dd2eb1f4b4", "sha256": "8ae2c28ca4d106c56738c3952dc02586b2a62e09d7c4a8a1792b28b211cfdec3" }, "downloads": -1, "filename": "uielem-0.2.2.tar.gz", "has_sig": false, "md5_digest": "3dc302ea01bb06b39ec273dd2eb1f4b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2902, "upload_time": "2018-10-04T14:32:48", "url": "https://files.pythonhosted.org/packages/04/e5/52798d1e63fc260d132421017bc93ebe29a9bdcb0e760cf847065ad10220/uielem-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f2384a20795c18acdc61a5111365add2", "sha256": "7c749eff68b10680dd4dc663189ab87c69c5c2b830f937d73d73c16f6f814e70" }, "downloads": -1, "filename": "uielem-0.2.2-py2-none-any.whl", "has_sig": false, "md5_digest": "f2384a20795c18acdc61a5111365add2", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 2516, "upload_time": "2018-10-04T14:32:46", "url": "https://files.pythonhosted.org/packages/ab/4e/a4940a24cd16a53f403402743bba15776a87fc634efba5e096ab88f2c11c/uielem-0.2.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3dc302ea01bb06b39ec273dd2eb1f4b4", "sha256": "8ae2c28ca4d106c56738c3952dc02586b2a62e09d7c4a8a1792b28b211cfdec3" }, "downloads": -1, "filename": "uielem-0.2.2.tar.gz", "has_sig": false, "md5_digest": "3dc302ea01bb06b39ec273dd2eb1f4b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2902, "upload_time": "2018-10-04T14:32:48", "url": "https://files.pythonhosted.org/packages/04/e5/52798d1e63fc260d132421017bc93ebe29a9bdcb0e760cf847065ad10220/uielem-0.2.2.tar.gz" } ] }