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
on_pre_enter and on_enter are not called when a Screen instance is declared in kv #2565
Comments
That's the same kind of issue that we have with The KV language does:
On the very first screen added in the screenmanager, the While we did something specific for Proposals: A. I'm thinking about a state that indicate the widget is still under construction ( B. Delay the add_widget until the widget is completly built. But this cannot works, as some rules might depends of others widget (id) and/or not built yet. |
Currently, the on_enter does get triggered from KV. But when first Screen's on_enter is triggered, the Screen does not yet have a name - self.name is still ''. How about postponing dispatching all events until the root is entirely built? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Was a solution ever implemented? Could on_enter be delayed until KV assigns a name? |
@victorbutler I'm not aware of any implemented solution, however I like the With |
Confirmed still a problem in Kivy 2.2.1, Windows 11. |
My workaround for this, if an on_enter was required on the "first" screen on a was to add a dummy first screen. I think this is a valid option, and could be documented rather than fixed.
|
The python equivalent works as expected. The bug only appears for the first added screen, and only at add time, subsequent screen changes fire the events.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: