A convenient and quick-access UI floating window for Python users to employ their custom code powered by tkinter. Including some custom-made toolkits.
The project is still in the early stages of construction, with many features yet to be made and implemented. here you can see the stage of the project's development.
The following libraries are required:
enum
logging
tkinter
pyperclip
PIL
math
win32clipboard
io
At the moment, pip installations are not supported, only direct source code downloads from GitHub are supported.
import quickToolbar
def THE-FUNCTION():
return 'RETURN-DATA'
quickToolbar.createButton(name = 'FUNCTION-NAME',
command = THE-FUNCTION ,
mode = quickToolbar.Mode.Api ,
returnType = quickToolbar.ReturnType.String ,
icon = 'ICON-FILE-PATH',
group = None)
quickToolbar.run()The logic of using this library is very simple and can be understood as follows:
- Import library:
import quickToolbar. - Create a button (import method):
quickToolbar.createButton() - Start the window:
quickToolbar.run()
Calling this will start the hover window and enter an internal loop, equivalent to calling tkinter's mainloop() with the same effect.
The only method that has parameters is the method quickToolbar.createButton(). The specific method definition is as follows
def createButton(name: str, command, mode: Mode, returnType=None, icon=None, group=None) -> None:| Parameters | Data Type | Must Be defined | Default Value | Description | Usage Examples |
|---|---|---|---|---|---|
name |
str |
Y | --- | Defines the name of the function button, names can't be same | name='METHOD-NAME' |
command |
❓ | Y | --- | Callable object❓, quickToolbar will automatically create the button to run it | command=lambda: print('Hello World.') |
mode |
quickToolbar.Mode |
Y | --- | Indicate to quickToolbar how the method should be run, e.g. whether it should be run once and then finished, or repeated until the window is closed, see here for details. | mode= quickToolbar.Mode.Api |
returnType |
quickToolbar.ReturnType |
N | None |
Indicate to quickToolbar what the data type returned by the method is, and quickToolbar will create a window for displaying the data based on that data type, or not if it's None, see here and here for details. |
returnType=quickToolbar.ReturnType.String |
icon |
str |
N | None |
Image file address, define the button icon, use a file type supported by the PIL library such as .png. Don't worry about the size of the image, quickToolbar will automatically scale the image.If the value is None,quickToolbar will use the first character of name as the icon. |
icon='Icons/icon.png' |
group |
🚧 (Coming soon) | 🚧 | 🚧 | 🚧 (Coming soon) |
| Description | |
|---|---|
Mode.Api |
For a method that can be executed quickly and is intended to be run only once |
Mode.Api_Repeat |
For a method that can be executed quickly, and will be repeatedly called and update the return value based on the defined repeat interval |
Mode.Concurrent_Thread |
For methods that require some time to process, by using the ThreadPoolExecutor from concurrent.futures to execute only once. |
Mode.Concurrent_Thread_Endless |
For methods that require some time to process, by using the ThreadPoolExecutor from concurrent.futures to execute until the window is closed. |
Mode.Concurrent_Process |
For methods that require some time to process, by using the ProcessPoolExecutor from concurrent.futures to execute only once. |
Mode.Concurrent_Process_Endless |
For methods that require some time to process, by using the ProcessPoolExecutor from concurrent.futures to execute until the window is closed. |
Mode.Async |
For methods that require some time to process, by using the multithreading from asyncio, execute only once. |
Mode.Async_Endless |
For methods that require some time to process, For methods that require some time to process, by using the multithreading from asyncio to execute until the window is closed. |
| returnType | Description |
|---|---|
ReturnType.String |
String object |
ReturnType.Image |
PIL Image object |
ReturnType.Auto |
When you don't know what type of data will be returned, use it, quickToolbar will automatically create a window based on the returned data type. |
Regarding the current state of development, the support for the returnType corresponding to Mode is as follows.
None |
ReturnType.String |
ReturnType.Image |
ReturnType.Auto |
🚧 | |
|---|---|---|---|---|---|
Mode.Api |
✔ | ✔ | ✔ | ✔ New | 🚧 |
Mode.Api_Repeat |
⏳ | ⏳ | ⏳ | 🚧 | 🚧 |
Mode.Concurrent_Thread |
🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
Mode.Concurrent_Thread_Endless |
🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
Mode.Concurrent_Process |
✔ New | ✔ New | ✔ New | ✔ New | 🚧 |
Mode.Concurrent_Process_Endless |
🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
Mode.Async |
🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
Mode.Async_Endless |
🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
✔ Support
⏳ In progress
🚧 Coming soon
🚧
Some program code originates from
Copy image to clipboard
by canbax
drag indicator by Google Inc.
Close by Benjamin J sperry on IconScout
Copy by Google Inc. on IconScout
