Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
made this project way more practical, efficient and maintainable
Alters:
Clicking on checkboxes now will not cause the program to sleep for 0.15 seconds.
Instead, to prevent multi-triggering when held down, the program checks if the checkbox was pressed in the last frame to avoid potential and obvious problems.
CALLBACKS
Users no longer need to detect if the button is pressed or if the checkbox is enabled in the main loop.
Instead, users now assign a function to the callback argument when defining the widget.
Once the callback is triggered, the function will be called immediately and automatically.
Fixed text for checkboxes and buttons.
Now, the text argument is usable for checkboxes and buttons.
When defining, the user would only need to text=str when defining the widget
Then, the text will automaticly be placed.
(In the button and beside the checkbox. )
Text alignments
Both horizontal and vertical alignments for text are supported.
Fixed multi-triggering
In the past, the corresponding function would be triggered per frame when a situation was reached (a button was pressed down, a checkbox was checked, etc.).
Now, with the callback, the required function will only be triggered once (when the button is initially clicked, and once when the checkbox is checked).
More managable widgets
Now, widgets will be saved in a list,
This enables the library to automatically render them, handle callbacks, and avoid multi-triggering.
Code format overhaul
Optimised the source code to follow PEP8, so it's more maintainable and readable
Compatible with previous projects
Although the new approaches are much more efficient and recommended,
previous programs using this library will still run smoothly.