Does pop up view or widget exists?

Is there a way to have a view on top of the running view to address use case where you need to ask an information or alert the user?
Or is it a matter of save state/kill view/create new one/close/create back the original view?

Yes, there is. You can use the z argument when adding the widget to the dock, something like:

 await self.view.dock(self.my_widget, edge="left", size=40, z=1)

If you make the widget invisible on_mount and make it visible when needed, it will appear above other widgets. If you want to animate the appearance of the widget, you can use something like below instead of setting the visible flag:

self.my_widget.animate("layout_offset_x", 0 if show_my_widget else -40)

Hope this helps.

1 Like