Hi All,
I am new to urwid and getting problems to draw a fixed size linebox around a
widget. Currently, when i draw a linebox around a listbox, the linebox is
shown like following figure-1:
[image: main.png]
but, what i need linebox like the following figure-2
[image: main_req.png]
following is the source code
#!/usr/bin/env python
import urwid
#create palette
palette = [('header', 'black', 'light gray'),
('bg', 'black', 'light gray')]
#create header(title message)
txt_title = urwid.Text("\n\nSimple Database\n\n", 'center')
#is there any other way to place empty lines below and above the text
instead of this
head = urwid.AttrMap(txt_title, 'header')
#create body
txt_open = urwid.Text("Add Record ", 'center')
txt_save = urwid.Text("Search Record", 'center')
txt_exit = urwid.Text("Exit", 'center')
menuList = urwid.SimpleListWalker([
txt_open
urwid.Divider(" "),
txt_save,
urwid.Divider(" "),
txt_exit
])
body = urwid.LineBox(urwid.ListBox(menuList))
#create frame
top = urwid.Frame(body, head)
top = urwid.AttrMap(top, 'bg')
def exit_on_cr(input):
if input == 'enter':
raise urwid.ExitMainLoop()
loop = urwid.MainLoop(top, palette, unhandled_input=exit_on_cr)
loop.run()
Can anyone help me to draw the linebox as in figure-2?
second, i want to add multiple flow widgets in the footer area of Frame, IS
THIS POSSIBLE? if yes/no, can any one kindly guide me to right direction?
Regards,
<<main_req.png>>
<<main.png>>
_______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
