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

Defer firing on_select event in GTK OptionContainer #2713

Merged
merged 3 commits into from
Jul 24, 2024

Conversation

freakboy3742
Copy link
Member

Fixes #2703.

Under GTK, the current_page() API doesn't return the current value while still in the on_select handler; as a result, a user-space event handler trying to retrieve the current tab will get the wrong result.

This change defers the execution of the on_select handler so that current_page() is guaranteed to return the correct result.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@mhsmith
Copy link
Member

mhsmith commented Jul 15, 2024

I can't test this until I've finished updating my Linux machine (toga-gtk requires pygobject >= 3.46.0, which requires system package glib-2.0 >= 2.64.0).

Co-authored-by: Malcolm Smith <[email protected]>
@mhsmith mhsmith merged commit cdff0dd into beeware:main Jul 24, 2024
34 of 35 checks passed
@freakboy3742 freakboy3742 deleted the gtk-tab-select branch July 24, 2024 23:00
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.

On GTK, OptionContainer current_tab returns wrong index
2 participants