Add value argument to command callback (non-breaking improvement)#15
Open
BlueJayVRStudio wants to merge 1 commit intoAkascape:mainfrom
Open
Add value argument to command callback (non-breaking improvement)#15BlueJayVRStudio wants to merge 1 commit intoAkascape:mainfrom
BlueJayVRStudio wants to merge 1 commit intoAkascape:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds support for passing the current dial value to the command callback across all dial types. Each dial now calls command(value) when its value changes, with a fallback to command() for backward compatibility. This enables proper on-change behavior without needing to call get(), while keeping existing code working. Multiple files were updated because the project has several separate dial classes, but the change is mechanical and consistent.
Previously, the callback received no information about the dial state, and there was no way to reconfigure the callback through the widget API. This meant the only practical way to access the current value inside a callback was to store the dial instance externally (for example in a global dictionary) and call get() from there. This pattern works, but it forces tight coupling between application code and widget instances, and prevents the use of simple reusable callbacks. Passing the value directly makes the widget easier to use, matches the conventions of other Tkinter widgets (such as Scale), and avoids the need for external lookup structures.
Usage example:
Zero-argument callbacks still work as before.