Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import urwid
- palette = [('focus', 'white', 'black'),
- ('unfocused', 'black', 'dark green')]
- def do_reply(input):
- if input == 'tab':
- if columns.get_focus() == flow1:
- columns.set_focus(flow2)
- else:
- columns.set_focus(flow1)
- buttons = [urwid.AttrMap(urwid.Button(str(x)), 'unfocused', focus_map='focus')
- for x in range(30)]
- flow1 = urwid.Filler(urwid.GridFlow(buttons, 10, 10, 10, 'center'))
- flow2 = urwid.Filler(urwid.GridFlow(buttons, 10, 10, 10, 'center'))
- columns = urwid.Columns([flow1, flow2])
- loop = urwid.MainLoop(columns, unhandled_input=do_reply, palette=palette)
- loop.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement