A package to use Searchbox instead of Combobox
Project description
This package is an inhanced version of ttk.Combobox. You can have a Searchbox in tkinter using this package for your tkinter apps. In a Searchbox widget, if you type part of an item and then click on the button, you will only see the items which contain a part of that text and you can find items easily. Another item which is added to attributes, is the sort attribute. If you use sort=True, the result items which are shown are sorted, otherwise, they will appear in the same order where you have listed them in the values attribute.
a simple example to learn how to use it:
from pmf_searchbox.searchbox import *
countries = ['United States','Afghanistan','Albania','Algeria','American Samoa','Andorra','Angola','Anguilla','Antarctica','Antigua And Barbuda','Argentina','Armenia','Aruba','Australia','Austria','Azerbaijan','Bahamas','Bahrain','Bangladesh','Barbados','Belarus','Belgium','Belize','Benin','Bermuda','Bhutan','Bolivia','Bosnia And Herzegowina','Botswana','Bouvet Island','Brazil','Brunei Darussalam','Bulgaria','Burkina Faso','Burundi','Cambodia','Cameroon','Canada','Cape Verde','Cayman Islands','Central African Rep','Chad','Chile','China','Christmas Island','Cocos Islands','Colombia','Comoros','Congo','Cook Islands','Costa Rica','Cote D`ivoire','Croatia','Cuba','Cyprus','Czech Republic','Denmark','Djibouti','Dominica','Dominican Republic','East Timor','Ecuador','Egypt','El Salvador','Equatorial Guinea','Eritrea','Estonia','Ethiopia','Falkland Islands (Malvinas)','Faroe Islands','Fiji','Finland','France','French Guiana','French Polynesia','French S. Territories','Gabon','Gambia','Georgia','Germany','Ghana','Gibraltar','Greece','Greenland','Grenada','Guadeloupe','Guam','Guatemala','Guinea','Guinea-bissau','Guyana','Haiti','Honduras','Hong Kong','Hungary','Iceland','India','Indonesia','Iran','Iraq','Ireland','Israel','Italy','Jamaica','Japan','Jordan','Kazakhstan','Kenya','Kiribati','Korea (North)','Korea (South)','Kuwait','Kyrgyzstan','Laos','Latvia','Lebanon','Lesotho','Liberia','Libya','Liechtenstein','Lithuania','Luxembourg','Macau','Macedonia','Madagascar','Malawi','Malaysia','Maldives','Mali','Malta','Marshall Islands','Martinique','Mauritania','Mauritius','Mayotte','Mexico','Micronesia','Moldova','Monaco','Mongolia','Montserrat','Morocco','Mozambique','Myanmar','Namibia','Nauru','Nepal','Netherlands','Netherlands Antilles','New Caledonia','New Zealand','Nicaragua','Niger','Nigeria','Niue','Norfolk Island','Northern Mariana Islands','Norway','Oman','Pakistan','Palau','Panama','Papua New Guinea','Paraguay','Peru','Philippines','Pitcairn','Poland','Portugal','Puerto Rico','Qatar','Reunion','Romania','Russian Federation','Rwanda','Saint Kitts And Nevis','Saint Lucia','St Vincent/Grenadines','Samoa','San Marino','Sao Tome','Saudi Arabia','Senegal','Seychelles','Sierra Leone','Singapore','Slovakia','Slovenia','Solomon Islands','Somalia','South Africa','Spain','Sri Lanka','St. Helena','St.Pierre','Sudan','Suriname','Swaziland','Sweden','Switzerland','Syrian Arab Republic','Taiwan','Tajikistan','Tanzania','Thailand','Togo','Tokelau','Tonga','Trinidad And Tobago','Tunisia','Turkey','Turkmenistan','Tuvalu','Uganda','Ukraine','United Arab Emirates','United Kingdom','Uruguay','Uzbekistan','Vanuatu','Vatican City State','Venezuela','Viet Nam','Virgin Islands (British)','Virgin Islands (U.S.)','Western Sahara','Yemen','Yugoslavia','Zaire','Zambia','Zimbabwe']
fruits = ['apple', 'pineapple', 'banana', 'kiwi', 'pamagranate', 'lemon', 'orange', 'papaya', 'tangerine', 'dragon fruit', 'cherry', 'sour cherry', 'watermelone', 'melone', 'strawberry', 'raspberry', 'sweet potato', 'tomato', 'cabbage']
root = Tk()
root.geometry('800x400+200+200')
Label(root, text="List of All countries: ", font=(None, 24)).grid(row=1, column=1)
Label(root, text="List of some fruits: ", font=(None, 24)).grid(row=2, column=1)
Searchbox(root, values=countries, font=(None, 24)).grid(row=1, column=2)
Searchbox(root, sort=True, values=fruits, font=(None, 24)).grid(row=2, column=2)
Label(root, text="Good Luck.", font=(None, 24)).place(x=300, y=300, width=200, height=100)
root.mainloop()
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 pmf_searchbox-0.0.3.tar.gz
.
File metadata
- Download URL: pmf_searchbox-0.0.3.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3490ea1ecd025daf231b394a719401fbfe3d8831fd751ef2957dad178750bd2c |
|
MD5 | 29293e760b0e9b5c6dda09d1f811426c |
|
BLAKE2b-256 | 66b81c34b8ba4850352dc13edfd3c823315b66408ab30dc255909a39fc89d6bd |
File details
Details for the file pmf_searchbox-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: pmf_searchbox-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c1a774b381e028dde5738b7fe99fe12e2a25880d82d8672ff1f9a80307f3a7 |
|
MD5 | dd78b0a0e6566e8a13ba919710d5af0d |
|
BLAKE2b-256 | a88d3a282e751decba2b47171bc78358d8c4b7956d8a74a6eedecd093677a7d4 |