Insert a Combobox into your GUI that allows suggestions based on what the user writes in
Project description
AutoCombobox
AutoCombobox is a Ttk widget based on the existing Combobox. It allows the user to write on the entry field, viewing at the same time some suggested option based on what the user writes. The suggestions are customizable through a function that can be defined by the developer.
Installation
AutoCombobox can be installed from PyPI using the command pip install autocombobox
.
It doesn't have any dependences other than Tkinter.
Usage
AutoCombobox was created specifically to be used like the normal Ttk Combobox, so all its options are available.
Beside that, it can accept the filter
option, that allows the developer to pass the function that determines the suggestions. The function must take 2 parameters: the first represent the list of all possible options of the Combobox, and the second represent the text written on the entry field; the function must returns a list of integers rappresenting the indices of the position of each option (a negative value indicates that the option will not be shown). There is a default filter function, that shows all the options that starts with the user input.
AutoCombobox makes available also various useful methods:
show_listbox
andhide_listbox
are the functions that manage the list of the Combobox options;update_values
takes an optional string and filters the list of all possible values based on it, to show only suggestions. If no strings is given, it is taken from the entry field;select
takes a string, and set the entry field with that. If the string is also in the possible value, it generate a<<ComboboxSelected>>
event;change_highlight
takes the index of the option we want to highglights.
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
File details
Details for the file autocombobox-1.4.0.tar.gz
.
File metadata
- Download URL: autocombobox-1.4.0.tar.gz
- Upload date:
- Size: 30.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53a16848099e18263b2098a7cd385428e778b1541af52f80501d989428a8fc6b |
|
MD5 | 8e8ca15e0b416429e1ad64e67b1e9dec |
|
BLAKE2b-256 | b085d8424cbe1cd2ca4118daca41f8143d50554b35c931d05a31b650d6d77464 |
File details
Details for the file autocombobox-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: autocombobox-1.4.0-py3-none-any.whl
- Upload date:
- Size: 30.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6226a8bc1a2329ee26af7d2ac38375c627fd06f3c8782c2b37995f67e5d77ba3 |
|
MD5 | 44118923301105e3b7f1d2673b231239 |
|
BLAKE2b-256 | 1ccc08f8e7d5e1553f4dc6bfabdf8cec7d26f5caecc0a82645e3292a32170635 |