Feather icons for tkinter
Project description
tkfeather
tkinter support for feather icons
Latest Changes
Current version: 1.0.0-rc1
- Initial release
Usage
Import
from tkfeather import Feather
Initialization:
Feather(name: str, size: int [optional])
Args
name: str
- The name of the Feather iconsize: int [optional]
- The size of the icon image in pixels, square (default: 24)
Note: Sizes smaller than 24px are allowed but aren't recommended as the icon will become blurred
The minimum allowed
size
is 1, and the maximum allowedsize
is 1024
Properties
Feather.icon
- anImageTk.PhotoImage
object for the given Feather icon
Class Methods
Feather.icons_available()
returns a list with the names of all available Feather Icons
Exceptions
- Passing a
size
value outside the range of 1 to 1024 will raise aValueError
- Trying to use an icon that doesn't exist will raise a
FileNotFoundError
Example
You must maintain a reference to the Feather instance in a variable in order to keep the image from being garbage-collected:
# this works
feather = Feather('home')
label = tk.Label(parent, image=feather.icon)
label.pack()
If you don't maintain a reference to the image, it won't appear!
# this doesn't work - the label will have no image
label = tk.Label(parent, image=Feather('home').icon)
label.pack()
Installation
pip install tkfeather
Packaged Dependencies
- PNG Icons
- Pillow >= 9.2.0
Acknowledgements
Based on Feather Icons originally created by Cole Bemis
Under MIT License
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
tkfeather-1.0.0.tar.gz
(5.2 MB
view hashes)
Built Distribution
Close
Hashes for tkfeather-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40c0e40699b76fa54cb5c32d1d1756d7a3a9f1d4f15e9095d20237d4a554696f |
|
MD5 | ae8f7bb71e17e28314b4ec040e0cbc12 |
|
BLAKE2b-256 | bf4ea99d77f96a0eafa270bc186462bc22746eea37876d913f4ebdf6cc17852d |