Skip to content

Instantly share code, notes, and snippets.

@wardi
Created July 9, 2015 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wardi/744d3bb721b0009df9b5 to your computer and use it in GitHub Desktop.
Save wardi/744d3bb721b0009df9b5 to your computer and use it in GitHub Desktop.
drop shadow in urwid
#!/usr/bin/env python
import urwid
thing_to_wrap = urwid.Text(' '.join(str(n) for n in range(1000, 1115)))
right_shadow = urwid.Pile([
(1, urwid.SolidFill(' ')),
urwid.SolidFill('X')])
bottom_shadow = urwid.Columns([
(2, urwid.SolidFill(' ')),
urwid.SolidFill('X')])
shadowed_thing = urwid.Pile([
urwid.Columns([thing_to_wrap, (2, right_shadow)], box_columns=[1]),
(1, bottom_shadow)])
surround = urwid.Padding(urwid.Filler(shadowed_thing),
align='center', width=('relative', 60))
urwid.MainLoop(surround).run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment