Ticket #67 (closed defect: fixed)

Opened 3 years ago

Last modified 23 months ago

Overlay breaks if the top window does not fit on the screen

Reported by: marienz Owned by: ian
Priority: major Milestone:
Component: unknown Version:
Keywords: Cc:

Description

The attached example, ran in urwid 0.9.9, breaks with:

AssertionError?: top canvas of overlay not the size expected!(10, 0, -6, 10)

if the terminal window it runs in is resized until the top window does not fit in it. It should probably just truncate the top window instead.

Change History

Changed 3 years ago by marienz

Inlining the failing example because trac does not let me attach a file (Permission denied for /var/local/trac/urwid/attachments/ticket/67...):

import urwid


def main(wrap=True):
    btext = urwid.Text('background ' * 100)
    ftext = urwid.Text('foreground ' * 100)
    python = urwid.PythonLogo()
    if wrap:
        ftext = urwid.LineBox(ftext)
    overlay = urwid.Overlay(ftext, urwid.Filler(btext),
                            'center', ('relative', 100),
                            'middle', None)
    mainloop = urwid.MainLoop(overlay)
    mainloop.run()


if __name__ == '__main__':
    main()

Changed 23 months ago by ian

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.