I know I can do the attron and attroff with the color I choose to, however, I would like to know if it\'s possible to do it with the ANSI colour es
I think you're probably straying into dangerous territory there. Curses will almost certainly track character positions based on output characters and, since it provides its own colour handling, it probably won't detect ANSI escape sequences as well.
It may work (did you try it?) but it may also stuff up the window management altogether.
And, since you stated in a comment that it didn't work then I guess the answer would be "no" :-)
If you're after a possible way to allow the ANSI escape sequences in your strings, then one way (kludge though it is) would be to intercept the string and modify it. Have a helper function like myPrintW() which takes a string and breaks it down, something like (pseudo-code):
def myPrintW(s):
while s not end of string:
s2 = position of color-change-sequence in s
if s2 == NULL exit while
printw characters from s (inclusive) to s2 (exclusive)
decode color-change-sequence at s2 and issue relevant attron/off
s = s2 + length of color-change-sequence
endwhile
enddef
This would basically break down the string into normal character sequences and color-change-sequences and you'd process each separately. It would require a lookup table in order to translate the sequences into the desired attron/off calls. Not pretty, but sometimes pragmatism is best.