0

I am creating a scrollable list using ncurses, similar to the list in aptitude (apt-get front end).

How should I go about creating padded spaces between columns? I am planning to write each column using wprintw().

e.g.

pizza      spicy      10
steak      normal     10
burritoes  guacamole  20

each line using wprintw().

jhtong
  • 1,529
  • 4
  • 23
  • 34

1 Answers1

0

The following will give you 2 space padded, left justified, string columns 10 characters wide, each followed by a space, then a 2 digit decimal column.

wprintw(win,"%-10s %-10s %2d\n", "pizza", "spicy", 10);
parkydr
  • 7,596
  • 3
  • 32
  • 42