-
Notifications
You must be signed in to change notification settings - Fork 734
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
Proper way to remove widgets #160
Comments
I've been poking around the source the past couple days and I haven't seen anything like |
You could also overwrite an area with a widget with None in a GridView for example, by using add_widget or place. There isn't really a proper way to do it |
I've tried to do |
Ok, looks like find some hacky solution that works: if isinstance(self.view.layout, DockLayout):
self.view.layout.docks.clear()
self.view.widgets.clear() |
@artur-shaik I was unable to get this to work outside of on_mount at the very start. How did you implement it? |
@stephenlutes I've implemented in inside textual event loop, not sure why you need it outside? |
I may be going about this the wrong way. I am trying to clear everything within an action when a certain key is pressed. Update |
Did we solve your problem? Consider buying the Textualize developers a coffee to say thanks. |
How I can properly reload my view with new widgets, by removing old ones?
The text was updated successfully, but these errors were encountered: