Oscar
2013-07-28 10:19:32 UTC
Hi,
I'm new to urwid but alhough I'm following all examples and trying all
the widgets of the reference guide, I can't get two buttons aligned to
the border of the screen. With the following code I get both buttons
centered on the screen:
import urwid
palette = [ ('head','yellow','black'),
('reversed','standout',''),('hola','white','black'),('gg','black','dark
cyan')]
helpa=urwid.Button("help_A")
helpb=urwid.Button("help_B")
everything=urwid.GridFlow((helpa, helpb), 10, 3, 1, "center")
loop = urwid.MainLoop(urwid.Filler(everything),palette)
loop.run()
Current 0utput:
????????????????????????????????????????????????????????????????????????????????
?
?
?
?
?
?
?
?
?
?
?
?
? <help_A> <help_B>
?
?
?
?
?
?
?
?
?
|
|
????????????????????????????????????????????????????????????????????????????????
Output wanted:
????????????????????????????????????????????????????????????????????????????????
?
?
?
?
?
?
?
?
?
?
?
?
? <help_A>
<help_B> ?
?
?
?
?
?
?
?
?
|
|
????????????????????????????????????????????????????????????????????????????????
Thanks in advance!
--
Oscar
I'm new to urwid but alhough I'm following all examples and trying all
the widgets of the reference guide, I can't get two buttons aligned to
the border of the screen. With the following code I get both buttons
centered on the screen:
import urwid
palette = [ ('head','yellow','black'),
('reversed','standout',''),('hola','white','black'),('gg','black','dark
cyan')]
helpa=urwid.Button("help_A")
helpb=urwid.Button("help_B")
everything=urwid.GridFlow((helpa, helpb), 10, 3, 1, "center")
loop = urwid.MainLoop(urwid.Filler(everything),palette)
loop.run()
Current 0utput:
????????????????????????????????????????????????????????????????????????????????
?
?
?
?
?
?
?
?
?
?
?
?
? <help_A> <help_B>
?
?
?
?
?
?
?
?
?
|
|
????????????????????????????????????????????????????????????????????????????????
Output wanted:
????????????????????????????????????????????????????????????????????????????????
?
?
?
?
?
?
?
?
?
?
?
?
? <help_A>
<help_B> ?
?
?
?
?
?
?
?
?
|
|
????????????????????????????????????????????????????????????????????????????????
Thanks in advance!
--
Oscar