A library which is intended to simplify a placement of widgets with .grid() and .pack() methods
Project description
Tkinter Layout Helpers
A library which is intended to simplify a placement of widgets with .grid()
and .pack()
methods:
- avoid manual calculation of indices of columns and rows when you add a widget;
- avoid typing-in some common parameters (like
sticky=tk.EW
) each time you add a widget; - and more...
Work in progress.
As an example, this code:
import tkinter as tk
from tkinter_layout_helpers.grid_helper import grid_manager
root = tk.Tk()
with grid_manager(root, sticky=tk.EW) as grid:
grid.new_row() \
.add(tk.Label(text="0", width=20)) \
.add(tk.Label(text="1", width=20)) \
.add(tk.Label(text="2", width=20)) \
.add(tk.Label(text="3", width=20)) \
.add(tk.Label(text="4", width=20))
grid.new_row().add(tk.Entry()).column_span(4).add(tk.Entry()).column_span(1)
grid.new_row().add(tk.Entry()).column_span(3).add(tk.Entry()).column_span(2)
grid.new_row().add(tk.Entry()).column_span(2).add(tk.Entry()).column_span(3)
grid.new_row().add(tk.Entry()).column_span(1).add(tk.Entry()).column_span(4)
grid.columnconfigure(0, weight=1)
grid.columnconfigure(1, weight=1)
grid.columnconfigure(2, weight=1)
grid.columnconfigure(3, weight=1)
grid.columnconfigure(4, weight=1)
root.mainloop()
Gives the following result:
More examples see here: examples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for tkinter_layout_helpers-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4264c5950936fb65a5dc5f090bb4be2cc45dbd5c9e15dea0e1fd71540867fb6 |
|
MD5 | 5eb825ab2f3d1d61697482057dd4e30c |
|
BLAKE2b-256 | e55254485f622131b76c55e38be5c81ec3ce0919a3164da3fcd057bd0bd4f11a |
Close
Hashes for tkinter_layout_helpers-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a6fdc16bc23f8a4a017affaaef3d09a27185b16bbdfc5936df6ced8f72c45d0 |
|
MD5 | bb3187751e0429000120e977cf4a7a77 |
|
BLAKE2b-256 | 6167bd07391075ba6e11a2eb9ec7b294d7e94511713c05c78051e7acc052d40c |