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

Added double buffering to remove flickering #352

Merged
merged 1 commit into from
Jan 4, 2022

Conversation

rocky3355
Copy link
Contributor

@rocky3355 rocky3355 commented Jan 2, 2022

The GUI elements were flickering due to missing buffering. Adding double buffering seemed to introduce issues with the rendering order, i.e. the texts below the Speedmeters would always be drawn over. As a workaround these texts were changed to be children of their corresponding Speedmeters.

The GUI elements were flickering due to missing buffering. Adding double buffering seemed to introduce issues with the rendering order, i.e. the texts below the speedmeters would always be drawn over. As a workaround these texts were changed to be children of their corresponding Speedmeters.
@WouterJD
Copy link
Owner

WouterJD commented Jan 4, 2022

I see you use .MinWidth instead of .Width, please explain the difference (I cannot find definitions).
Also, I rounded all calculations to int (to avoid complaints from wxpython); any reason why you don't?

Always happy to learn :-)

@WouterJD WouterJD merged commit 5794e75 into WouterJD:master Jan 4, 2022
@rocky3355
Copy link
Contributor Author

I see you use .MinWidth instead of .Width, please explain the difference (I cannot find definitions). Also, I rounded all calculations to int (to avoid complaints from wxpython); any reason why you don't?

Always happy to learn :-)

Well, the "TextCtrl" does not seem to have a "Width" property, only "MinWidth" and "MaxWidth". I tried to use MaxWidth, but it was always set to -1. That's the simple reason I ended up using the MinWidth property 😄 Maybe the "Size" property or something else stores the real current width, but I never worked with wxpython before.

For the integer rounding, I wasn't really thinking about this when quickly trying to find a solution. For sure, rounding them to int is the better approach ;)

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.

2 participants