Created
July 9, 2015 22:40
-
-
Save wardi/744d3bb721b0009df9b5 to your computer and use it in GitHub Desktop.
drop shadow in urwid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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