[Urwid] Showing a dialog on top of a custom widget

Ian Ward ian at excess.org
Wed Jan 1 17:25:54 EST 2014


On Wed, Jan 1, 2014 at 3:59 PM, Florian Paul Schmidt
<mista.tapas at gmx.net> wrote:
>         Just as an example: Let's say the user wants to add a track. He
> should then be prompted for the name. So ideally I'd like to "overlay"
> a single line text edit over the last line (the menu) where the user
> can then enter the name. The overlay widget doesn't seem right, since
> the program logic to implement that would then leak down all the way
> to the root of the widget hierarchy (in my case there's only one
> widget for now ;D). Also it doesn't seem to like the top_w to be None..

Hi Florian,

Take a look at examples/pop_up.py.

That example creates a pop-up that is anchored to another widget on
the screen. The trick is using PopUpTarget that inserts an Overlay at
the root of the widget hierarchy when required.



More information about the Urwid mailing list