Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented CtkSpinBox #2275

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FedericoSpada
Copy link

Implemented the true CtkSpinBox by copying CtkComboBox and performing the needed changes.

image

I didn't dare to touch DrawEngine.draw_rounded_rect_with_border_vertical_split(), so for now there is just one button and I discern the "up" or "down" section by looking at the relative mouse position within the canvas. This has the side effect that when you hover on it with the mouse, both "buttons" are highlighted simultaneously, but it's not that ugly.

Parameters from_ and to impose limits to the number that can be displayed, while by providing the value parameter, you can pick elements from any List. Thanks to step_button and step_scroll parameters you can choose how much the value (or List index) is changed if you click a button or scroll the mouse wheel respectively. default_value is self-explanatory but it is effective only if a tkinter.Variable is not provided. Finally, the format parameter is used to invoke the format() method on it to display other text that is not part of the value (for example, measurement units).

Implemented the true CtkSpinBox by copying CtkComboBox and performing the needed changes.
Fixed a bug that prevented using the variable to update SpinBox's content
Minor type hint changes
@Anonymous6598
Copy link

That's awesome! We will almost replace Tkinter framework. Great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants