Search code examples
python-3.xurwid

How do I remove spaces between my Urwid Widgets?


I am trying to design a console application, on Python, using Urwid. I am having trouble with my Widgets (Lineboxes here): the Lineboxes have space between each other, which impacts the overall aspect of the application. When those Lineboxes are deleted, I get what I want (no spaces), but also lose what I want (a line delimiting my different widgets). Is it possible to remove the space automatically generated between adjacent lineboxes ?

Note: I use urwid.Columns and urwid.Pile to stack my widgets.

Here is the problem: https://i.sstatic.net/1ekSc.jpg

Thanks!


Solution

  • you're never going to get rid of that space because of the nature of those characters. The thing to do is read the docs for linebox, it'll let you explicitly call out what characters to use for your corners and side. So for example, lets say you have 2 box side by side, box 1 and 2. for box 1, the right most top corner would be the "T" ascii figure and the bottom right corner would be the upside down T. Then box 2 you would describe with no left corners or sides (" ").