Skip to main content

Wrapper class around CTkTable to let users select rows

Project description

CTkTableRowSelector

Wrapper class around CTkTable to let users select rows. PyPI PyPI - License Code style: black

Features

  • Plug&Play: No shady attributes, create an instance and get the values you need.
  • Easy to use interface.
  • Select multiple rows using CTRL-Key.
  • Headers are selectable or not, based on your need.
  • 100% test coverage. All interactions with the CTkTable are tested using pytest.
  • Stable.
  • Vertical table support.

Install

pip install CTkTableRowSelector

Example

Note: You can run a more advanced example using python3 -m CTkTableRowSelector.

import customtkinter
from CTkTable import *
from CTkTableRowSelector import *

root = customtkinter.CTk()

value = [
    ["Header" + letter for letter in "ABCDE"],
    *[[i, i+1, i+2, i+3, i+4] for i in range(0, 25, 5)]
]
table = CTkTable(master=root, row=5, column=5, values=value)
table.pack(expand=True, fill="both", padx=20, pady=20)

# Add the selector
row_selector = CTkTableRowSelector(table)

# Get the value
button = customtkinter.CTkButton(
    root, text="Print selected rows", command=lambda: print(row_selector.get())
)
button.pack(pady=(0, 20))

root.mainloop()

## Licence This project is delivered under the MIT Licence.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctktablerowselector-1.0.1.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

ctktablerowselector-1.0.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page