-
Notifications
You must be signed in to change notification settings - Fork 780
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
IndexError: pop from empty list
while calling pop_screen
#3041
Comments
Alright, I investigated it a little bit more and this is not related to the Explanation:The issue comes directly from: #1792 Because we had to define 2 classes for the same screen, just with different bindings like This caused another problem - we had to take care of replacing the dashboard screen (which is always located at the bottom of the So we prepared a couple of methods for that like def push_screen_at(self, index: int, screen: str | Screen[ScreenResultType]) -> None:
"""Push a screen at the given index in the stack."""
screen_, _ = self.app._get_screen(screen)
# screen_._push_result_callback(None, None) # After updating textual to the newest version we had this line missing.
self.app._screen_stack.insert(index, screen_) So it seems to me that you can notice an interesting problem here, which is not entirely clear how to solve - due to the lack of the possibility to use dynamic bindings and the lack of appropriate methods for better management of screens (like the two mentioned above) such problems appear. If there is already a recommended path, please point me to it, but it seems to me that there is no solution for this type of problem yet, because I follow the textual status quite closely. I would like to ask you @willmcgugan to refer to this topic, perhaps my problem will help to notice the deficiencies in the textual, or will outline a path for others how to deal with such a situation. |
Closing as its not a Textual issue. |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Textual version of 0.30.0
Related: #2650
I think it's related to the
switch_screen
call with "screen" asstr
and notScreen
instanceMy logging includes "with screen as string" postfix when
push_screen
orswitch_screen
is called with "screen" asstr
Here's the sequence:
The text was updated successfully, but these errors were encountered: