0

此代码结果屏幕: foobar (OK)

stdscr.addstr(10, 10, "foobar")

此代码结果屏幕:foobar (OK)

stdscr.addstr(10, 10, "foobar", curses.A_REVERSE)

但是如何获得结果屏幕 fo ob ar ?

请咨询任何人?谢谢你。

4

1 回答 1

0

Just split this into more than one addstr() call. For example:

stdscr.addstr(10, 10, 'fo..ar')
stdscr.addstr(10, 12, 'ob', curses.A_REVERSE)

Instead of the dots you can use spaces. The dots make it easier to see how many characters are between 'fo' and 'ar'. If the cursor position at the end of the output is important either split the output into three function calls in the order the text parts should appear or set the cursor position explicitly after adding the text.

于 2015-05-19T14:37:40.767 回答